From 3a4814517435bccb469bd24ae82030dc66871256 Mon Sep 17 00:00:00 2001
From: cshapiro <cshapiro>
Date: Sun, 7 Sep 2008 07:07:50 +0000
Subject: [PATCH] Remove code to support very old releases of Solaris 2.

---
 lisp/Config.sun4_solaris_gcc  |   8 +-
 lisp/Config.sun4_solaris_sunc |   6 +-
 lisp/solaris-os.c             | 100 +--------------
 lisp/sunos-os.c               | 230 +---------------------------------
 lisp/undefineds.h             |  24 ++--
 5 files changed, 12 insertions(+), 356 deletions(-)

diff --git a/lisp/Config.sun4_solaris_gcc b/lisp/Config.sun4_solaris_gcc
index 855186090..babd5f990 100644
--- a/lisp/Config.sun4_solaris_gcc
+++ b/lisp/Config.sun4_solaris_gcc
@@ -8,8 +8,6 @@ vpath %.h .:$(PATH1)
 vpath %.c .:$(PATH1)
 vpath %.S .:$(PATH1)
 
-# For Solaris 2.4 or earlier, remove -DSOLARIS25 from CPPFLAGS.
-
 # For v8plus support (allows 64-bit integer support on V9
 # architectures), uncomment the definitions for CC_V8PLUS and
 # AS_V8PLUS.  The -Wa,xarch=v8plus option tells the assembler to
@@ -38,7 +36,7 @@ GENCGC = -DGENCGC
 GC_SRC = gencgc.c
 endif
 
-CPPFLAGS = -I. -I$(PATH1) -DSOLARIS -DSOLARIS25 -DSVR4 $(CC_V8PLUS) $(LINKAGE) $(GENCGC)
+CPPFLAGS = -I. -I$(PATH1) -DSOLARIS -DSVR4 $(CC_V8PLUS) $(LINKAGE) $(GENCGC)
 
 # Note: If you want to be able to run gdb with cmucl, the only version
 # of gdb that still works for me (rtoy) on Solaris is 4.18.  Versions
@@ -62,10 +60,6 @@ NM = $(PATH1)/solaris-nm
 ASSEM_SRC = sparc-assem.S
 ARCH_SRC = sparc-arch.c
 
-# For Solaris, you may also use sunos-os.c instead of solaris-os.c.
-# This has been checked out on Solaris 2.7 (aka 7) without problems.
-# The resulting binaries work ok on 2.5.
-
 OS_SRC = solaris-os.c os-common.c undefineds.c elf.c k_rem_pio2.c
 OS_LINK_FLAGS=
 OS_LIBS= -lsocket -lnsl -ldl
diff --git a/lisp/Config.sun4_solaris_sunc b/lisp/Config.sun4_solaris_sunc
index 6f14af523..716b730bd 100644
--- a/lisp/Config.sun4_solaris_sunc
+++ b/lisp/Config.sun4_solaris_sunc
@@ -35,7 +35,7 @@ GENCGC = -DGENCGC
 GC_SRC = gencgc.c
 endif
 
-CPPFLAGS = -Dinline= -I. -I$(PATH1) -DSOLARIS -DSOLARIS25 -DSVR4 $(CC_V8PLUS) $(LINKAGE) $(GENCGC)
+CPPFLAGS = -Dinline= -I. -I$(PATH1) -DSOLARIS -DSVR4 $(CC_V8PLUS) $(LINKAGE) $(GENCGC)
 
 
 CC = cc -O -xlibmieee
@@ -52,10 +52,6 @@ NM = $(PATH1)/solaris-nm
 ASSEM_SRC = sparc-assem.S
 ARCH_SRC = sparc-arch.c
 
-# For Solaris, you may also use sunos-os.c instead of solaris-os.c.
-# This has been checked out on Solaris 2.7 (aka 7) without problems.
-# The resulting binaries work ok on 2.5.
-
 DEPEND=$(CC) 
 DEPEND_FLAGS = -xM
 OS_SRC = solaris-os.c os-common.c undefineds.c elf.c k_rem_pio2.c
diff --git a/lisp/solaris-os.c b/lisp/solaris-os.c
index 8bcc4d39b..bb37779d3 100644
--- a/lisp/solaris-os.c
+++ b/lisp/solaris-os.c
@@ -1,5 +1,5 @@
 /*
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/solaris-os.c,v 1.20 2008/03/19 09:17:13 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/solaris-os.c,v 1.21 2008/09/07 07:07:50 cshapiro Exp $
  *
  * OS-dependent routines.  This file (along with os.h) exports an
  * OS-independent interface to the operating system VM facilities.
@@ -331,93 +331,6 @@ solaris_register_address(struct ucontext *context, int reg)
 
 /* For now we put in some porting functions */
 
-#ifndef SOLARIS25
-int
-getdtablesize(void)
-{
-    return sysconf(_SC_OPEN_MAX);
-}
-
-char *
-getwd(char *path)
-{
-    return getcwd(path, MAXPATHLEN);
-}
-
-int
-getpagesize(void)
-{
-    return sysconf(_SC_PAGESIZE);
-}
-
-
-#include <sys/procfs.h>
-/* Old rusage definition */
-struct rusage {
-    struct timeval ru_utime;	/* user time used */
-    struct timeval ru_stime;	/* system time used */
-    long ru_maxrss;
-#define ru_first        ru_ixrss
-    long ru_ixrss;		/* XXX: 0 */
-    long ru_idrss;		/* XXX: sum of rm_asrss */
-    long ru_isrss;		/* XXX: 0 */
-    long ru_minflt;		/* any page faults not requiring I/O */
-    long ru_majflt;		/* any page faults requiring I/O */
-    long ru_nswap;		/* swaps */
-    long ru_inblock;		/* block input operations */
-    long ru_oublock;		/* block output operations */
-    long ru_msgsnd;		/* messages sent */
-    long ru_msgrcv;		/* messages received */
-    long ru_nsignals;		/* signals received */
-    long ru_nvcsw;		/* voluntary context switches */
-    long ru_nivcsw;		/* involuntary " */
-#define ru_last         ru_nivcsw
-};
-
-
-int
-getrusage(int who, struct rusage *rp)
-{
-    memset(rp, 0, sizeof(struct rusage));
-
-    return 0;
-}
-
-int
-setreuid(void)
-{
-    fprintf(stderr, "setreuid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-setregid(void)
-{
-    fprintf(stderr, "setregid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-gethostid(void)
-{
-    fprintf(stderr, "gethostid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-killpg(int pgrp, int sig)
-{
-    if (pgrp < 0) {
-	errno = ESRCH;
-	return -1;
-    }
-    return kill(-pgrp, sig);
-}
-#endif
-
 int
 sigblock(int mask)
 {
@@ -431,17 +344,6 @@ sigblock(int mask)
     return old.__sigbits[0];
 }
 
-#ifndef SOLARIS25
-int
-wait3(int *status, int options, struct rusage *rp)
-{
-    if (rp)
-	memset(rp, 0, sizeof(struct rusage));
-
-    return waitpid(-1, status, options);
-}
-#endif
-
 int
 sigsetmask(int mask)
 {
diff --git a/lisp/sunos-os.c b/lisp/sunos-os.c
index 0d9d028e9..7412f9488 100644
--- a/lisp/sunos-os.c
+++ b/lisp/sunos-os.c
@@ -1,5 +1,5 @@
 /*
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sunos-os.c,v 1.9 2008/03/19 09:17:13 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sunos-os.c,v 1.10 2008/09/07 07:07:49 cshapiro Rel $
  *
  * OS-dependent routines.  This file (along with os.h) exports an
  * OS-independent interface to the operating system VM facilities.
@@ -19,21 +19,11 @@
 #include <signal.h>
 #include <sys/file.h>
 
-#ifdef SOLARIS
-#include <unistd.h>
-#include <errno.h>
-#include <sys/param.h>
-#define OS_PROTERR		SEGV_ACCERR
-#define OS_MAPERR		SEGV_MAPERR
-#define OS_HASERRNO(code)	((code)->si_errno != 0)
-#define OS_ERRNO(code)		((code)->si_errno)
-#else
 #define OS_PROTERR		SEGV_PROT
 #define OS_MAPERR		SEGV_NOMAP
 #define OS_HASERRNO(code)	(SEGV_CODE(code)==SEGV_OBJERR)
 #define OS_ERRNO(code)		SEGV_ERRNO(code)
 extern int errno;
-#endif /* SOLARIS */
 
 #include "os.h"
 /* To get dynamic_0_space and friends */
@@ -107,12 +97,7 @@ os_init(void)
     if (zero_fd < 0)
 	os_init_bailout(ZEROFILE);
 
-
-#ifdef SOLARIS
-    os_vm_page_size = os_real_page_size = sysconf(_SC_PAGESIZE);
-#else
     os_vm_page_size = os_real_page_size = getpagesize();
-#endif
 
     max_segments = INITIAL_MAX_SEGS;
     segments = (struct segment *) malloc(sizeof(struct segment) * max_segments);
@@ -649,28 +634,6 @@ os_flush_icache(address, length)
     if (kr != KERN_SUCCESS)
 	mach_error("Could not flush the instruction cache", kr);
 #endif
-#ifdef SOLARIS			/* also SunOS ?? */
-    static int flushit = -1;
-
-    /*
-     * On some systems, iflush needs to be emulated in the kernel
-     * On those systems, it isn't necessary
-     * Call getenv() only once.
-     */
-    if (flushit == -1)
-	flushit = getenv("CMUCL_NO_SPARC_IFLUSH") == 0;
-
-    if (flushit) {
-	static int traceit = -1;
-
-	if (traceit == -1)
-	    traceit = getenv("CMUCL_TRACE_SPARC_IFLUSH") != 0;
-
-	if (traceit)
-	    fprintf(stderr, ";;;iflush %p - %x\n", address, length);
-	flush_icache(address, length);
-    }
-#endif
 }
 
 void
@@ -752,18 +715,9 @@ maybe_gc(HANDLER_ARGS)
  *
  * Running into the gc trigger page will also end up here...
  */
-#ifndef SOLARIS
 void
 segv_handler(HANDLER_ARGS, caddr_t addr)
-#else
-void
-segv_handler(HANDLER_ARGS)
-#endif				/* SOLARIS */
 {
-#ifdef SOLARIS
-    caddr_t addr = code->si_addr;
-#endif
-
     SAVE_CONTEXT();
 
     if (CODE(code) == OS_PROTERR) {	/* allow writes to this chunk */
@@ -863,188 +817,6 @@ os_install_interrupt_handlers(void)
     interrupt_install_low_level_handler(SIGSEGV, segv_handler);
 }
 
-
-#ifdef SOLARIS
-
-
-/* function defintions for register lvalues */
-
-int *
-solaris_register_address(struct ucontext *context, int reg)
-{
-    if (reg == 0) {
-	static int zero;
-
-	zero = 0;
-
-	return &zero;
-    } else if (reg < 16) {
-	return &context->uc_mcontext.gregs[reg + 3];
-    } else if (reg < 32) {
-	int *sp = (int *) context->uc_mcontext.gregs[REG_SP];
-
-	return &sp[reg - 16];
-    } else
-	return 0;
-}
-
-/* function defintions for backward compatibilty and static linking */
-
-#if 0
-void *
-dlopen(const char *file, int flag)
-{
-    return 0;
-}
-
-void *
-dlsym(void *obj, const char *sym)
-{
-    return 0;
-}
-
-int
-dlclose(void *obj)
-{
-    return 0;
-}
-
-char *
-dlerror(void)
-{
-    return "no dynamic linking";
-}
-#endif
-
-/* For now we put in some porting functions */
-
-#ifndef SOLARIS25
-int
-getdtablesize(void)
-{
-    return sysconf(_SC_OPEN_MAX);
-}
-
-char *
-getwd(char *path)
-{
-    return getcwd(path, MAXPATHLEN);
-}
-
-int
-getpagesize(void)
-{
-    return sysconf(_SC_PAGESIZE);
-}
-
-
-#include <sys/procfs.h>
-/* Old rusage definition */
-struct rusage {
-    struct timeval ru_utime;	/* user time used */
-    struct timeval ru_stime;	/* system time used */
-    long ru_maxrss;
-#define ru_first        ru_ixrss
-    long ru_ixrss;		/* XXX: 0 */
-    long ru_idrss;		/* XXX: sum of rm_asrss */
-    long ru_isrss;		/* XXX: 0 */
-    long ru_minflt;		/* any page faults not requiring I/O */
-    long ru_majflt;		/* any page faults requiring I/O */
-    long ru_nswap;		/* swaps */
-    long ru_inblock;		/* block input operations */
-    long ru_oublock;		/* block output operations */
-    long ru_msgsnd;		/* messages sent */
-    long ru_msgrcv;		/* messages received */
-    long ru_nsignals;		/* signals received */
-    long ru_nvcsw;		/* voluntary context switches */
-    long ru_nivcsw;		/* involuntary " */
-#define ru_last         ru_nivcsw
-};
-
-
-int
-getrusage(int who, struct rusage *rp)
-{
-    memset(rp, 0, sizeof(struct rusage));
-
-    return 0;
-}
-
-int
-setreuid(void)
-{
-    fprintf(stderr, "setreuid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-setregid(void)
-{
-    fprintf(stderr, "setregid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-gethostid(void)
-{
-    fprintf(stderr, "gethostid unimplemented\n");
-    errno = ENOSYS;
-    return -1;
-}
-
-int
-killpg(int pgrp, int sig)
-{
-    if (pgrp < 0) {
-	errno = ESRCH;
-	return -1;
-    }
-    return kill(-pgrp, sig);
-}
-#endif
-
-int
-sigblock(int mask)
-{
-    sigset_t old, new;
-
-    sigemptyset(&new);
-    new.__sigbits[0] = mask;
-
-    sigprocmask(SIG_BLOCK, &new, &old);
-
-    return old.__sigbits[0];
-}
-
-#ifndef SOLARIS25
-int
-wait3(int *status, int options, struct rusage *rp)
-{
-    if (rp)
-	memset(rp, 0, sizeof(struct rusage));
-
-    return waitpid(-1, status, options);
-}
-#endif
-
-int
-sigsetmask(int mask)
-{
-    sigset_t old, new;
-
-    sigemptyset(&new);
-    new.__sigbits[0] = mask;
-
-    sigprocmask(SIG_SETMASK, &new, &old);
-
-    return old.__sigbits[0];
-
-}
-
-#endif /* SOLARIS */
-
 os_vm_address_t round_up_sparse_size(os_vm_address_t addr)
 {
     return (addr + SPARSE_BLOCK_SIZE - 1) & ~SPARSE_SIZE_MASK;
diff --git a/lisp/undefineds.h b/lisp/undefineds.h
index 1c69ad121..26dca850f 100644
--- a/lisp/undefineds.h
+++ b/lisp/undefineds.h
@@ -1,5 +1,5 @@
 /* Routines that must be linked into the core for lisp to work. */
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.38 2008/02/08 21:17:57 rtoy Exp $ */
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.39 2008/09/07 07:07:50 cshapiro Exp $ */
 
 /*
  * Do not wrap this inside an #ifndef/#endif!
@@ -44,41 +44,35 @@ F(accept)
     F(fstat)
     F(fsync)
     F(ftruncate)
-#if !defined(hpux) && !defined(SVR4) || defined(SOLARIS25) || defined(irix)
+#if !defined(hpux) && !defined(SVR4) || defined(SOLARIS) || defined(irix)
     F(getdtablesize)
 #endif
     F(getegid)
     F(geteuid)
     F(getgid)
     F(getgroups)
-#if !defined (SOLARIS) || defined(SOLARIS25)
     F(gethostid)
-#endif
     F(gethostname)
     F(getitimer)
-#if !defined(hpux) && !defined(SVR4) || defined(SOLARIS25)
+#if !defined(hpux) && !defined(SVR4) || defined(SOLARIS)
     F(getpagesize)
 #endif
     F(getpeername)
     F(getpgrp)
     F(getpid)
     F(getppid)
-#if !defined(SVR4)  ||  defined(SOLARIS25)
+#if !defined(SVR4)  ||  defined(SOLARIS)
     F(getpriority)
 #endif
     F(getrlimit)
-#if !defined(SOLARIS) ||  defined(SOLARIS25)
     F(getrusage)
-#endif
     F(getsockname)
     F(getsockopt)
     F(gettimeofday)
     F(getuid)
     F(ioctl)
     F(kill)
-#if !defined(SOLARIS) || defined(SOLARIS25)
     F(killpg)
-#endif
     F(link)
     F(listen)
     F(lseek)
@@ -114,21 +108,21 @@ F(accept)
     F(sendmsg)
     F(sendto)
     F(setgroups)
-#if !defined(SUNOS) && !(defined(SOLARIS) ||  defined(SOLARIS25))
+#if !defined(SUNOS) && !defined(SOLARIS)
     F(sethostid)
 #endif
-#if !defined(SVR4) ||  defined(SOLARIS25)
+#if !defined(SVR4) ||  defined(SOLARIS)
     F(sethostname)
 #endif
     F(setitimer)
     F(setpgrp)
-#if !defined(SVR4) ||  defined(SOLARIS25)
+#if !defined(SVR4) ||  defined(SOLARIS)
     F(setpriority)
 #endif
 #if !defined(mach) && !defined(SOLARIS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(SUNOS) && !defined(osf1) && !defined(irix) && !defined(hpux) && !(defined(linux) && defined(alpha))
     F(setquota)
 #endif
-#if !defined(hpux) && !defined(SVR4) ||  defined(SOLARIS25)
+#if !defined(hpux) && !defined(SVR4) ||  defined(SOLARIS)
     F(setregid)
     F(setreuid)
 #endif
@@ -193,9 +187,7 @@ F(accept)
     F(vhangup)
 #endif
     F(wait)
-#if !defined(SOLARIS) ||  defined(SOLARIS25)
     F(wait3)
-#endif
     F(write)
     F(writev)
 
-- 
GitLab