From 1df45b5beb561fe76b408b5d1de2eb7109ff2f75 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 19 Sep 1991 12:54:23 +0000 Subject: [PATCH] Updates and fixes --- mach/minixST/libsys/LIST | 2 -- mach/minixST/libsys/_exec.c | 3 +-- mach/minixST/libsys/_fcntl.c | 27 +++++++++++++++++++-------- mach/minixST/libsys/_getcwd.c | 5 ++--- mach/minixST/libsys/_utime.c | 3 ++- mach/minixST/libsys/fpathconf.c | 2 +- mach/minixST/libsys/pathconf.c | 1 - 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/mach/minixST/libsys/LIST b/mach/minixST/libsys/LIST index a689c9b96..bed45182a 100644 --- a/mach/minixST/libsys/LIST +++ b/mach/minixST/libsys/LIST @@ -32,7 +32,6 @@ mkdir.s mkfifo.s mknod.s mknod4.s -mktemp.s mount.s open.s pause.s @@ -93,7 +92,6 @@ _mkdir.c _mkfifo.c _mknod.c _mknod4.c -_mktemp.c _mount.c _open.c pathconf.c diff --git a/mach/minixST/libsys/_exec.c b/mach/minixST/libsys/_exec.c index 816533aa4..cc4ddf9ad 100644 --- a/mach/minixST/libsys/_exec.c +++ b/mach/minixST/libsys/_exec.c @@ -1,10 +1,9 @@ #include -#include +#include #define execl _execl #define execle _execle #define execv _execv #define execve _execve -#include extern char **environ; /* environment pointer */ diff --git a/mach/minixST/libsys/_fcntl.c b/mach/minixST/libsys/_fcntl.c index 780280de8..f96eebf6f 100644 --- a/mach/minixST/libsys/_fcntl.c +++ b/mach/minixST/libsys/_fcntl.c @@ -1,21 +1,32 @@ #include #define fcntl _fcntl #include -#include +#if _ANSI +#endif #if _ANSI +#include PUBLIC int fcntl(int fd, int cmd, ...) +{ #else -PUBLIC int fcntl(fd, cmd) +#include +PUBLIC int fcntl(va_alist) +va_dcl +{ int fd; int cmd; #endif -{ - va_list argp; + va_list ap; int int3; /* third integer parameter for callm1 */ char *ptr1; /* first pointer parameter for callm1 */ - va_start(argp, cmd); +#if _ANSI + va_start(ap, cmd); +#else + va_start(ap); + fd = va_arg(ap, int); + cmd = va_arg(ap, int); +#endif /* Set up for the sensible case where there is no variable parameter. This * covers F_GETFD, F_GETFL and invalid commands. @@ -28,16 +39,16 @@ int cmd; case F_DUPFD: case F_SETFD: case F_SETFL: - int3 = va_arg(argp, int); + int3 = va_arg(ap, int); break; case F_GETLK: case F_SETLK: case F_SETLKW: - ptr1 = (char *) va_arg(argp, struct flock *); + ptr1 = (char *) va_arg(ap, struct flock *); break; } /* Clean up and make the system call. */ - va_end(argp); + va_end(ap); return(_callm1(FS, FCNTL, fd, cmd, int3, ptr1, NIL_PTR, NIL_PTR)); } diff --git a/mach/minixST/libsys/_getcwd.c b/mach/minixST/libsys/_getcwd.c index cfe8eac8b..92546aa73 100644 --- a/mach/minixST/libsys/_getcwd.c +++ b/mach/minixST/libsys/_getcwd.c @@ -8,13 +8,12 @@ #include #include #include -#define getcwd _getcwd -#include #include +#define getcwd _getcwd #define DIRECT_SIZE (sizeof (struct direct)) -PRIVATE _PROTOTYPE(void, go_back(char *path) ); +PRIVATE _PROTOTYPE(void go_back, (char *path) ); char *getcwd(buffer, size) char *buffer; diff --git a/mach/minixST/libsys/_utime.c b/mach/minixST/libsys/_utime.c index 6586a8386..c22dbcd88 100644 --- a/mach/minixST/libsys/_utime.c +++ b/mach/minixST/libsys/_utime.c @@ -1,12 +1,13 @@ /* _utime(2) for POSIX Authors: Terrence W. Holm & Edwin L. Froese */ #include -#include #define time _time #include #define utime _utime #include +long time(); + PUBLIC int utime(name, timp) char *name; struct utimbuf *timp; diff --git a/mach/minixST/libsys/fpathconf.c b/mach/minixST/libsys/fpathconf.c index 923e63e2a..8448d9c36 100644 --- a/mach/minixST/libsys/fpathconf.c +++ b/mach/minixST/libsys/fpathconf.c @@ -1,12 +1,12 @@ /* POSIX fpathconf (Sec. 5.7.1) Author: Andy Tanenbaum */ #include +#include #include #define fstat _fstat #include #include #include -#include PUBLIC long fpathconf(fd, name) int fd; /* file descriptor being interrogated */ diff --git a/mach/minixST/libsys/pathconf.c b/mach/minixST/libsys/pathconf.c index 6473feb11..c4476165e 100644 --- a/mach/minixST/libsys/pathconf.c +++ b/mach/minixST/libsys/pathconf.c @@ -6,7 +6,6 @@ #include #include #define close _close -#include PUBLIC long pathconf(path, name) char *path; /* name of file being interrogated */