diff options
Diffstat (limited to 'lang/modula-3-lib/files/patch-ab')
-rw-r--r-- | lang/modula-3-lib/files/patch-ab | 204 |
1 files changed, 173 insertions, 31 deletions
diff --git a/lang/modula-3-lib/files/patch-ab b/lang/modula-3-lib/files/patch-ab index 69e469154810..634192afcb8f 100644 --- a/lang/modula-3-lib/files/patch-ab +++ b/lang/modula-3-lib/files/patch-ab @@ -1,15 +1,19 @@ Fix a const-related compiler warning produced by the "execve" wrapper. Move network related wrappers to separate files, for SOCKS support. Fix some things so that it will compile under FreeBSD-3.0. -Add a wrapper for the "chflags" system call. +Add missing wrappers for various system calls. Fix numerous argument declarations to agree with their prototypes. Fix the wrapper for ftruncate so that it deals properly with the 64-bit arguments. Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c --- RTHeapDepC.c.orig Sat Mar 23 14:52:21 1996 -+++ RTHeapDepC.c Wed Apr 23 10:01:01 1997 -@@ -92,6 +92,16 @@ ++++ RTHeapDepC.c Thu Jul 10 18:16:04 1997 +@@ -89,9 +89,20 @@ + #include <ufs/ufs/quota.h> + #include <sys/signal.h> + #include <sys/socket.h> ++#include <sys/stat.h> #include <sys/uio.h> #include <sys/wait.h> @@ -26,7 +30,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c #ifdef NULL #undef NULL #endif -@@ -110,22 +120,8 @@ +@@ -110,22 +121,8 @@ /* Unless otherwise noted, all the following wrappers have the same structure. */ @@ -50,7 +54,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int mode; { int result; -@@ -137,7 +133,7 @@ +@@ -137,7 +134,7 @@ } int acct(file) /* ok */ @@ -59,7 +63,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -228,19 +224,6 @@ +@@ -228,19 +225,6 @@ } */ @@ -79,7 +83,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c /* not implemented int cachectl(addr, nbytes, op) char *addr; -@@ -268,7 +251,7 @@ +@@ -268,7 +252,7 @@ */ int chdir(path) /* ok */ @@ -88,7 +92,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -278,6 +261,18 @@ +@@ -278,8 +262,20 @@ return result; } @@ -105,9 +109,12 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c +} + int chmod(path, mode) /* ok */ - char *path; +-char *path; ++const char *path; mode_t mode; -@@ -291,7 +286,7 @@ + { int result; + +@@ -291,7 +287,7 @@ } int chown(path, owner, group) /* ok */ @@ -116,7 +123,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c uid_t owner; gid_t group; { int result; -@@ -304,7 +299,7 @@ +@@ -304,7 +300,7 @@ } int chroot(dirname) /* ok */ @@ -125,7 +132,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -314,19 +309,6 @@ +@@ -314,19 +310,6 @@ return result; } @@ -145,7 +152,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c /* not implemented (obsolete) int creat(name, mode) const char *name; -@@ -356,8 +338,8 @@ +@@ -356,8 +339,8 @@ result = syscall(SYS_execve, name, argv, envp); if (result == -1 && errno == EFAULT) { MAKE_READABLE(name); @@ -156,7 +163,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c } else { return result; } -@@ -473,7 +455,7 @@ +@@ -473,7 +456,7 @@ int getgroups(gidsetsize, grouplist) /* ok */ int gidsetsize; @@ -165,7 +172,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -513,20 +495,6 @@ +@@ -513,20 +496,6 @@ } */ @@ -186,7 +193,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int getrlimit(resource, rlp) /* ok */ int resource; struct rlimit *rlp; -@@ -551,20 +519,6 @@ +@@ -551,20 +520,6 @@ return result; } @@ -207,9 +214,25 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int getsockopt(s, level, optname, optval, optlen) /* ok */ int s, level, optname; void *optval; -@@ -630,8 +584,8 @@ +@@ -629,9 +584,24 @@ + return result; } ++#ifdef SYS_lchown ++int lchown(path, owner, group) /* ok */ ++const char *path; ++uid_t owner; ++gid_t group; ++{ int result; ++ ++ ENTER_CRITICAL; ++ MAKE_READABLE(path); ++ result = syscall(SYS_lchown, path, owner, group); ++ EXIT_CRITICAL; ++ return result; ++} ++#endif /* SYS_lchown */ ++ int link(name1, name2) /* ok */ -char *name1; -char *name2; @@ -218,16 +241,47 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -668,7 +622,7 @@ +@@ -643,7 +613,7 @@ + } + + int lstat(path, buf) /* ok */ +-char *path; ++const char *path; + struct stat *buf; + { int result; + +@@ -656,7 +626,7 @@ } + int mkdir(path, mode) /* ok */ +-char *path; ++const char *path; + mode_t mode; + { int result; + +@@ -667,8 +637,20 @@ + return result; + } + ++int mkfifo(path, mode) /* ok */ ++const char *path; ++mode_t mode; ++{ int result; ++ ++ ENTER_CRITICAL; ++ MAKE_READABLE(path); ++ result = syscall(SYS_mkfifo, path, mode); ++ EXIT_CRITICAL; ++ return result; ++} ++ int mknod(path, mode, dev) /* ok */ -char *path; +const char *path; mode_t mode; dev_t dev; { int result; -@@ -821,21 +775,8 @@ +@@ -821,21 +803,8 @@ return result; } @@ -250,7 +304,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c char *buf; int bufsiz; { int result; -@@ -865,46 +806,6 @@ +@@ -865,46 +834,6 @@ return result; } @@ -297,7 +351,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int recvmsg(s, msg, flags) /* ok */ int s; struct msghdr msg[]; -@@ -940,7 +841,7 @@ +@@ -940,7 +869,7 @@ } int rmdir(path) /* ok */ @@ -306,7 +360,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -950,24 +851,6 @@ +@@ -950,24 +879,6 @@ return result; } @@ -331,7 +385,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int semctl(semid, semnum, cmd, arg) /* ok ? */ int semid, cmd; int semnum; -@@ -1012,24 +895,6 @@ +@@ -1012,24 +923,6 @@ return result; } @@ -356,7 +410,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int sendmsg(s, msg, flags) /* ok */ int s; const struct msghdr msg[]; -@@ -1051,29 +916,8 @@ +@@ -1051,29 +944,8 @@ return result; } @@ -387,7 +441,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int namelen; { int result; -@@ -1086,7 +930,7 @@ +@@ -1086,7 +958,7 @@ int setgroups(ngroups, gidset) /* ok */ int ngroups; @@ -396,7 +450,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -1097,7 +941,7 @@ +@@ -1097,7 +969,7 @@ } int sethostname(name, namelen) /* ok */ @@ -405,7 +459,95 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c int namelen; { int result; #if __FreeBSD__ >= 2 -@@ -1280,7 +1124,7 @@ +@@ -1213,20 +1085,20 @@ + return result; + } + +-/* not implemented +-int sigpending(set) +-sigset_t *set; ++int sigaction(sig, act, oact) ++int sig; ++const struct sigaction *act; ++struct sigaction *oact; + { int result; + + ENTER_CRITICAL; +- MAKE_WRITABLE(set); +- result = syscall(SYS_sigpending, set); ++ MAKE_READABLE(act); ++ MAKE_WRITABLE(oact); ++ result = syscall(SYS_sigaction, sig, act, oact); + EXIT_CRITICAL; + return result; + } +-*/ + +-#if __FreeBSD__ >= 2 + int sigaltstack(ss, oss) /* ok */ + const struct sigaltstack *ss; + struct sigaltstack *oss; +@@ -1239,20 +1111,42 @@ + EXIT_CRITICAL; + return result; + } +-#else +-int sigstack(ss, oss) /* ok */ +-const struct sigstack *ss; +-struct sigstack *oss; ++ ++int sigpending(set) ++sigset_t *set; + { int result; + + ENTER_CRITICAL; +- MAKE_READABLE(ss); +- MAKE_WRITABLE(oss); +- result = syscall(SYS_sigstack, ss, oss); ++ MAKE_WRITABLE(set); ++ result = syscall(SYS_sigpending, set); ++ EXIT_CRITICAL; ++ return result; ++} ++ ++int sigprocmask(how, set, oset) ++int how; ++const sigset_t *set; ++sigset_t *oset; ++{ int result; ++ ++ ENTER_CRITICAL; ++ MAKE_READABLE(set); ++ MAKE_WRITABLE(oset); ++ result = syscall(SYS_sigprocmask, how, set, oset); ++ EXIT_CRITICAL; ++ return result; ++} ++ ++int sigsuspend(sigmask) ++const sigset_t *sigmask; ++{ int result; ++ ++ ENTER_CRITICAL; ++ MAKE_WRITABLE(sigmask); ++ result = syscall(SYS_sigsuspend, sigmask); + EXIT_CRITICAL; + return result; + } +-#endif + + int socketpair(d, type, protocol, sv) /* ok */ + int d, type, protocol; +@@ -1267,7 +1161,7 @@ + } + + int stat(path, buf) /* ok */ +-char *path; ++const char *path; + struct stat *buf; + { int result; + +@@ -1280,7 +1174,7 @@ } int swapon(special) /* ok */ @@ -414,7 +556,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -1291,8 +1135,8 @@ +@@ -1291,8 +1185,8 @@ } int symlink(name1, name2) /* ok */ @@ -425,7 +567,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -1304,14 +1148,14 @@ +@@ -1304,14 +1198,14 @@ } int truncate(path, length) /* ok */ @@ -444,7 +586,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c EXIT_CRITICAL; return result; } -@@ -1328,7 +1172,7 @@ +@@ -1328,7 +1222,7 @@ } int unlink(path) /* ok */ @@ -453,7 +595,7 @@ Index: m3/m3core/src/runtime/FreeBSD2/RTHeapDepC.c { int result; ENTER_CRITICAL; -@@ -1414,19 +1258,6 @@ +@@ -1414,19 +1308,6 @@ ENTER_CRITICAL; MAKE_WRITABLE(status); result = syscall(SYS_wait4, pid, status, options, NULL); |