From 9fc27527905db9907b37b77033d1a739567568be Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Tue, 14 Jul 2020 20:05:32 -0700 Subject: [PATCH] Changes necessary to compile for OS5 (Solaris 10/11) when -DSYSVONLY is removed from the compilation flags. modified: src/dsk.c modified: src/ldeether.c modified: src/main.c modified: src/timer.c modified: src/ufs.c modified: src/unixfork.c modified: src/vmemsave.c modified: src/xrdopt.c --- src/dsk.c | 16 ++++++++++++---- src/ldeether.c | 10 ++++++---- src/main.c | 1 + src/timer.c | 2 +- src/ufs.c | 15 +++++---------- src/unixfork.c | 2 +- src/vmemsave.c | 2 +- src/xrdopt.c | 2 +- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/dsk.c b/src/dsk.c index 00ae347..b4c7ad6 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -15,7 +15,7 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #include "version.h" -#if defined(MACOSX) || defined(FREEBSD) || defined(LINUX) +#if defined(MACOSX) || defined(FREEBSD) || defined(LINUX) || defined(OS5) #include #endif @@ -29,7 +29,9 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #ifndef SYSVONLY #ifndef MACOSX #ifndef FREEBSD +#ifndef OS5 #include +#endif /* OS5 */ #endif /* FREEBSD */ #endif /* MACOSX */ #endif /* SYSVONLY */ @@ -82,11 +84,12 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #define L_SET SEEK_SET #endif /* ISC */ -#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) +#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) || defined(OS5) #include #include #define direct dirent #define d_namlen d_reclen +#define d_fileno d_ino #ifndef LINUX #define L_SET SEEK_SET #endif @@ -2364,6 +2367,8 @@ LispPTR COM_getfreeblock(register LispPTR *args) char drive[2]; #ifdef ULTRIX struct fs_data sfsbuf; +#elif defined(OS5) + struct statvfs sfsbuf; #else #ifndef AIXPS2 #ifndef DOS @@ -2464,9 +2469,12 @@ LispPTR COM_getfreeblock(register LispPTR *args) #elif INDIGO TIMEOUT(rval = statfs(dir, &sfsbuf, sizeof(struct statfs), 0)); if (rval != 0) { -#elif SYSVONLY +#elif defined(SYSVONLY) TIMEOUT(rval = statfs(dir, &sfsbuf, sizeof(struct statfs), 0)); if (rval != 0) { +#elif defined(OS5) + TIMEOUT(rval = statvfs(dir, &sfsbuf)); + if (rval != 0) { #else #ifndef AIXPS2 TIMEOUT(rval = statfs(dir, &sfsbuf)); @@ -2483,7 +2491,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) *buf = (sfsbuf.f_bavail) * 4; /* AIX 3.1 returns no. of 4K blocks */ #elif defined(ISC) *buf = (sfsbuf.f_bfree) / 2; /* ISC claims 1K blocks, but it's really 512b */ -#elif defined(SYSVONLY) +#elif defined(SYSVONLY) || defined(OS5) *buf = sfsbuf.f_bfree; #elif (!defined(AIXPS2)) *buf = sfsbuf.f_bavail; diff --git a/src/ldeether.c b/src/ldeether.c index 5c373f6..1dd43ff 100644 --- a/src/ldeether.c +++ b/src/ldeether.c @@ -29,11 +29,11 @@ int main(int argc, char *argv[]) { return (0); } #include #include -#if defined(SVR4) && !defined(SUNOS5) +#if defined(SVR4) && !defined(OS5) char *devices[] = {"emd0", "emd1", "emd2", "emd3", "emd4", 0}; #endif -#ifdef SUNOS5 +#ifdef OS5 #include char *devices[] = {"le0", "le1", "le2", "le3", "le4", "ie0", "ie1", "ie2", "ie3", @@ -68,6 +68,7 @@ char *devices[] = {"le0", "le1", "le2", "le3", "le4", "ie0", "ie1", "i #include #include #include +#include #endif /* NOETHER */ @@ -108,8 +109,9 @@ int main(int argc, char *argv[]) { /* Use DLPI to connect to the ethernet. This code is stolen from NFSWATCH4.3 */ - - if (ether_fd = setup_dlpi_dev(NULL)) { /* Open an ether interface */ + char *etherdev = (char *)getenv("LDEETHERDEV"); + ether_fd = setup_dlpi_dev(etherdev); + if (ether_fd >= 0) { /* Open an ether interface */ ether_intf_type = dlpi_devtype(ether_fd); printf("opened ldeether fd %d.\n", ether_fd); /* first and foremost, get the packet filter module attached diff --git a/src/main.c b/src/main.c index 92f9097..ddb4e80 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,7 @@ static char *id = "$Id: main.c,v 1.4 2001/12/26 22:17:03 sybalsky Exp $ Copyrigh #ifndef DOS #include #include +#include #else /* DOS */ #define MAXPATHLEN 128 #define R_OK 04 diff --git a/src/timer.c b/src/timer.c index f2b29dd..62c1275 100644 --- a/src/timer.c +++ b/src/timer.c @@ -511,7 +511,7 @@ extern u_int LispWindowFd; static struct sigvec timerv; #endif /* SYSVSIGNALS */ -#if (defined(OS4) || defined(SYSVONLY)) || defined(MACOSX) || defined(FREEBSD) +#if (defined(OS4) || defined(SYSVONLY)) || defined(MACOSX) || defined(FREEBSD) || defined(OS5) void int_timer_service(int sig, int code, struct sigcontext *scp) #else int int_timer_service(int sig, int code, struct sigcontext *scp) diff --git a/src/ufs.c b/src/ufs.c index 73cc088..2c2619d 100644 --- a/src/ufs.c +++ b/src/ufs.c @@ -48,7 +48,7 @@ static char *id = "$Id: ufs.c,v 1.2 1999/01/03 02:07:41 sybalsky Exp $ Copyright #endif /* APOLLO */ #endif /* AIX */ -#if defined(SYSVONLY) || defined(FREEBSD) +#if defined(SYSVONLY) || defined(FREEBSD) || defined(OS5) #include #include #endif /* SYSVONLY | FREEBSD */ @@ -96,14 +96,6 @@ int Dummy_errno; /* If errno cell is not provided by Lisp, dummy_errno is used. /***********************************************/ /* file-system-specific defns */ /***********************************************/ -#ifdef DOS -#define DIRSEP '\\' -#define DIRSEPSTR "\\" -#else -#define DIRSEP '/' -#define DIRSEPSTR "/" -#endif -#define DRIVESEP ':' /* Used to limit DOS filenames to 8.3 format */ @@ -913,12 +905,15 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp) strcpy(lispname, "<"); return (1); } + +#ifdef DOS /* Split off the drive, if there is one. */ if (fullname[1] == DRIVESEP) { *lispname++ = *fullname++; *lispname++ = *fullname++; } - +#endif + if (!dirp) { /* * The characters which are dealt with specialy (i.e. are quoted) diff --git a/src/unixfork.c b/src/unixfork.c index 54361f4..acd2e8f 100644 --- a/src/unixfork.c +++ b/src/unixfork.c @@ -66,7 +66,7 @@ typedef int clockid_t; #include #endif /* HPUX */ -#ifdef SYSVONLY +#if defined(SYSVONLY) || defined(OS5) #include #include #endif /* SYSVONLY */ diff --git a/src/vmemsave.c b/src/vmemsave.c index 33024b3..7cc3021 100644 --- a/src/vmemsave.c +++ b/src/vmemsave.c @@ -44,7 +44,7 @@ static char *id = "$Id: vmemsave.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ Copy #include #include -#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) +#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) || defined(OS5) #include #include #include diff --git a/src/xrdopt.c b/src/xrdopt.c index e45420f..526b1cd 100644 --- a/src/xrdopt.c +++ b/src/xrdopt.c @@ -26,7 +26,7 @@ static char *id = "$Id: xrdopt.c,v 1.6 2001/12/26 22:17:07 sybalsky Exp $ Copyri #include /* needed for Ethernet stuff below */ #endif /* USE_DLPI */ #endif /* NOETHER */ -#ifdef SYSVONLY +#if defined(SYSVONLY) || defined(OS5) #include #endif /* SYSVONLY */ #include