/* -*-C-*-
-$Id: config.h,v 9.95 1996/03/04 20:32:53 cph Exp $
+$Id: config.h,v 9.96 1996/12/16 04:37:14 cph Exp $
Copyright (c) 1987-96 Massachusetts Institute of Technology
# define HAS_MODF
#endif
+#ifdef __linux
+extern void * linux_heap_malloc (unsigned long);
+#define HEAP_MALLOC linux_heap_malloc
+#endif
+
#if defined(WINNT) && !defined(WINNT_RAW_ADDRESSES)
/* This kludge exists because of Win32s which allocates
/* -*-C-*-
System file for Linux
-$Id: linux.h,v 1.9 1996/12/11 07:21:37 cph Exp $
+$Id: linux.h,v 1.10 1996/12/16 04:40:03 cph Exp $
Copyright (c) 1995-96 Massachusetts Institute of Technology
#define ALTERNATE_M4 s/ultrix.m4
-/* The following change is necessary if ELF binaries are used.
- Unfortunately, it is insufficient, because the Linux ELF
- implementation also moves the text and data segments to 0x08000000,
- which means that all of the pointer manipulation code must be
- changed. This is normal for some architectures, e.g. the MIPS and
- HPPA, but it make the binaries for Linux ELF different for the
- binaries for all other i386 machines.
-
- Since I don't currently know any way to adjust the mapping of the
- segments, if ELF is in use, I'll just force the switch that causes
- GCC to generate a.out format instead of ELF. This is a temporary
- patch, because one of these days a.out won't be supported, but
- hopefully by then we'll know how to fix this correctly. */
-
#ifdef __ELF__
#define M4_SWITCH_SYSTEM -P "define(LINUX_ELF,1)"
-#define LD_SWITCH_SYSTEM -rdynamic -T s/linuxelf.lds
+/* This is kind of random -- the only system that I've tried this on
+ is Debian 1.1, which uses ncurses for its termcap support (Debian
+ 0.93R6 used termcap instead). Debian can have -ltermcap, but it's
+ an optional package and often not installed. */
#define LIBS_TERMCAP -lncurses
#else
#define M4_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
#define LIBS_TERMCAP -ltermcap
#endif
+#define LD_SWITCH_SYSTEM
+
/* These definitions configure the microcode to support dynamic loading. */
#define SOURCES_SYSTEM pruxdld.c
#define OBJECTS_SYSTEM pruxdld.o
/* -*-C-*-
-$Id: ux.c,v 1.14 1996/04/23 20:58:45 cph Exp $
+$Id: ux.c,v 1.15 1996/12/16 04:37:31 cph Exp $
Copyright (c) 1990-96 Massachusetts Institute of Technology
{
UX_free (ptr);
}
+
+#ifdef __linux
+
+#include <sys/mman.h>
+
+void *
+linux_heap_malloc (unsigned long requested_length)
+{
+ unsigned long ps = (getpagesize ());
+ void * addr
+ = (mmap (((void *) ps),
+ (((requested_length + (ps - 1)) / ps) * ps),
+ (PROT_EXEC | PROT_READ | PROT_WRITE),
+ (MAP_PRIVATE | MAP_ANONYMOUS),
+ 0, 0));
+ return ((addr == ((void *) (-1))) ? 0 : addr);
+}
+
+#endif /* __linux */