diff --git a/lisp/interr.c b/lisp/interr.c index 46773b374cffe79b32a0ef5ddf09b76b51a54a02..d5ef6e6be25f8f6e04c71df57f5f28d30e168804 100644 --- a/lisp/interr.c +++ b/lisp/interr.c @@ -1,5 +1,5 @@ /* - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interr.c,v 1.1 1992/07/28 20:14:32 wlott Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interr.c,v 1.1.1.1 1994/10/24 19:47:21 ram Exp $ * * Stuff to handle internal errors. * @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdarg.h> +#include "arch.h" #include "signal.h" #include "lisp.h" @@ -15,7 +16,6 @@ #include "interr.h" #include "print.h" #include "lispregs.h" -#include "arch.h" /* Lossage handler. */ diff --git a/lisp/os-common.c b/lisp/os-common.c index 2a9377015cce26a4079ff0996c355c0b4cb19dc8..f6174f4f772912c9d2162c953acd911d8e5db571 100644 --- a/lisp/os-common.c +++ b/lisp/os-common.c @@ -68,7 +68,11 @@ os_vm_address_t os_reallocate(os_vm_address_t addr, os_vm_size_t old_len, if(len_diff<0) os_invalidate(addr+len,-len_diff); else if(len_diff!=0){ +#if 1 + os_vm_address_t new= NULL; +#else os_vm_address_t new=os_validate(addr+old_len,len_diff); +#endif if(new==NULL || new!=addr+old_len){ if(new!=NULL) @@ -84,6 +88,10 @@ os_vm_address_t os_reallocate(os_vm_address_t addr, os_vm_size_t old_len, addr=new; } +#if 0 + else + fprintf(stderr,"Map grow: [0x%08x] %x -> %x\n", addr, old_len,len); +#endif } return addr; diff --git a/lisp/parse.c b/lisp/parse.c index d89ecac5a29c1ba992fadda468529b4342745308..5fde13f7ced80a0a26693c9e448a139419e02a7b 100644 --- a/lisp/parse.c +++ b/lisp/parse.c @@ -1,4 +1,4 @@ -/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/parse.c,v 1.1 1992/07/28 20:15:14 wlott Exp $ */ +/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/parse.c,v 1.1.1.1 1994/10/24 19:49:55 ram Exp $ */ #include <stdio.h> #include <ctype.h> #include <signal.h> @@ -8,14 +8,14 @@ #include "globals.h" #include "vars.h" #include "parse.h" +#include "os.h" #include "interrupt.h" #include "lispregs.h" #include "monitor.h" #include "arch.h" -#include "os.h" #include "search.h" -#ifndef MACH +#if !defined(MACH) && !defined(SVR4) static int strcasecmp(s1,s2) char *s1,*s2; diff --git a/lisp/runprog.c b/lisp/runprog.c index 3ecd58bc0284f7d7e65821abea218fc51fee2ad1..ed122a7b133bce0b4e5edd21ae0207b3463533fa 100644 --- a/lisp/runprog.c +++ b/lisp/runprog.c @@ -1,12 +1,16 @@ /* - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/runprog.c,v 1.1 1993/08/04 11:25:08 wlott Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/runprog.c,v 1.1.1.1 1994/10/24 19:50:05 ram Exp $ * * Support for run-program. * */ #include <sys/file.h> +#include <sys/fcntl.h> #include <sys/ioctl.h> +#ifdef SVR4 +#include <unistd.h> +#endif int spawn(char *program, char *argv[], char *envp[], char *pty_name, int stdin, int stdout, int stderr) @@ -18,15 +22,17 @@ int spawn(char *program, char *argv[], char *envp[], char *pty_name, return pid; /* Put us in our own process group. */ -#ifdef hpux +#if defined(hpux) setsid(); +#elif defined(SVR4) + setpgrp(); #else setpgrp(0, getpid()); #endif /* If we are supposed to be part of some other pty, go for it. */ if (pty_name) { -#ifndef hpux +#if !defined(hpux) && !defined(SVR4) fd = open("/dev/tty", O_RDWR, 0); if (fd >= 0) { ioctl(fd, TIOCNOTTY, 0); @@ -50,8 +56,13 @@ int spawn(char *program, char *argv[], char *envp[], char *pty_name, dup2(stderr, 2); /* Close all other fds. */ +#ifdef SVR4 + for (fd = sysconf(_SC_OPEN_MAX)-1; fd >= 3; fd--) + close(fd); +#else for (fd = getdtablesize()-1; fd >= 3; fd--) close(fd); +#endif /* Exec the program. */ execve(program, argv, envp); diff --git a/lisp/socket.c b/lisp/socket.c index f8c843ebcf384bed2dec992ce8744ec8261a2c07..9a21aceedfa78e7756a024af6735211d076f3692 100644 --- a/lisp/socket.c +++ b/lisp/socket.c @@ -20,6 +20,8 @@ #include <netinet/tcp.h> #endif +#include "os.h" + extern int errno; /* Certain (broken) OS's don't have this */ /* decl in errno.h */ @@ -34,7 +36,9 @@ extern int errno; /* Certain (broken) OS's don't have this */ #endif /* hpux */ #endif /* X_UNIX_PATH */ #endif /* UNIXCONN */ +#ifndef bcopy void bcopy(); +#endif /* * Attempts to connect to server, given host and display. Returns file diff --git a/lisp/sunos-os.h b/lisp/sunos-os.h index 8d2eb79c3ba92957fabc3fee4b387be1e5ffd6e2..0f17acc3b9bae781e667804d46d977486b1a5c08 100644 --- a/lisp/sunos-os.h +++ b/lisp/sunos-os.h @@ -1,6 +1,26 @@ +#ifdef SOLARIS +#undef boolean +#endif /* SOLARIS */ + #include <sys/types.h> + +#ifdef SOLARIS +#define boolean int +#include <signal.h> +#include <unistd.h> +#include <sys/fcntl.h> +#endif /* SOLARIS */ + #include <sys/mman.h> +#ifdef SOLARIS +#include <ucontext.h> +#define sigcontext ucontext + +#define POSIX_SIGS + +#endif /* SOLARIS */ + typedef unsigned long os_vm_address_t; typedef long os_vm_size_t; typedef off_t os_vm_offset_t; @@ -11,3 +31,18 @@ typedef int os_vm_prot_t; #define OS_VM_PROT_EXECUTE PROT_EXEC #define OS_VM_DEFAULT_PAGESIZE 8192 + +#ifdef SOLARIS +#include <ucontext.h> +#define HANDLER_ARGS int signal, siginfo_t *code, struct ucontext *context +#define CODE(code) ((code) ? code->si_code : 0) +#define SAVE_CONTEXT() save_context() + +#ifdef NULL +#undef NULL +#define NULL 0 +#endif + +#define bcopy(a,b,n) memmove(b,a,n) +#define bzero(a,n) memset(a,0,n) +#endif /* SOLARIS */ diff --git a/lisp/vars.c b/lisp/vars.c index 09aacbd760cc874a70ee8791be6760d3877f2f56..dfe39c1b3086d7ee957d8c4b7637310cc5d753f2 100644 --- a/lisp/vars.c +++ b/lisp/vars.c @@ -1,10 +1,11 @@ -/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/vars.c,v 1.1 1992/07/28 20:15:38 wlott Exp $ */ +/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/vars.c,v 1.1.1.1 1994/10/24 19:53:01 ram Exp $ */ #include <stdio.h> #include <sys/types.h> #include <stdlib.h> #include "lisp.h" #include "vars.h" +#include "os.h" #define NAME_BUCKETS 31 #define OBJ_BUCKETS 31