diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-09-17 12:57:51 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-09-17 12:57:51 +0000 |
commit | c82d6ae7d51a0d747311de7946fea210edc17853 (patch) | |
tree | 8483dca6681068a3912b4f4a164d2be8ab9598e9 | |
parent | 22c8a1e4bbf7d6cdab4954f884809837923c84b7 (diff) |
move __syscall prototype into unistd.h (like everybody else) and avoid private protos for it everywhere; millert@ ok
-rw-r--r-- | include/unistd.h | 5 | ||||
-rw-r--r-- | lib/libc/sys/ftruncate.c | 9 | ||||
-rw-r--r-- | lib/libc/sys/lseek.c | 6 | ||||
-rw-r--r-- | lib/libc/sys/mmap.c | 9 | ||||
-rw-r--r-- | lib/libc/sys/pread.c | 7 | ||||
-rw-r--r-- | lib/libc/sys/preadv.c | 7 | ||||
-rw-r--r-- | lib/libc/sys/pwrite.c | 7 | ||||
-rw-r--r-- | lib/libc/sys/pwritev.c | 7 | ||||
-rw-r--r-- | lib/libc/sys/truncate.c | 9 |
9 files changed, 28 insertions, 38 deletions
diff --git a/include/unistd.h b/include/unistd.h index 49112b95ab7..92536c5bfc0 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.40 2002/08/30 08:24:55 espie Exp $ */ +/* $OpenBSD: unistd.h,v 1.41 2002/09/17 12:57:50 mickey Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /*- @@ -206,6 +206,9 @@ int swapctl(int cmd, const void *arg, int misc); int symlink(const char *, const char *); void sync(void); int syscall(int, ...); +#if !defined(_XOPEN_SOURCE) +quad_t __syscall(quad_t, ...); +#endif int truncate(const char *, off_t); int ttyslot(void); unsigned int ualarm(unsigned int, unsigned int); diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c index c7f4bf3a6b6..34da96b077f 100644 --- a/lib/libc/sys/ftruncate.c +++ b/lib/libc/sys/ftruncate.c @@ -32,17 +32,14 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ftruncate.c,v 1.7 1998/11/20 11:18:52 d Exp $"; +static char rcsid[] = "$OpenBSD: ftruncate.c,v 1.8 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> #include <sys/syscall.h> +#include <unistd.h> #include "thread_private.h" -#ifdef lint -quad_t __syscall(quad_t, ...); -#endif - /* * This function provides 64-bit offset padding that * is not supplied by GCC 1.X but is supplied by GCC 2.X. @@ -57,7 +54,7 @@ ftruncate(fd, length) if (_FD_LOCK(fd, FD_RDWR, NULL) != 0) { retval = -1; } else { - retval = __syscall((quad_t)SYS_ftruncate, fd, 0, length); + retval = __syscall(SYS_ftruncate, fd, 0, length); _FD_UNLOCK(fd, FD_RDWR); } return retval; diff --git a/lib/libc/sys/lseek.c b/lib/libc/sys/lseek.c index 12d2a98c86f..c94d2c5689f 100644 --- a/lib/libc/sys/lseek.c +++ b/lib/libc/sys/lseek.c @@ -32,11 +32,12 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: lseek.c,v 1.6 1998/11/20 11:18:53 d Exp $"; +static char rcsid[] = "$OpenBSD: lseek.c,v 1.7 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> #include <sys/syscall.h> +#include <unistd.h> #include "thread_private.h" /* @@ -49,13 +50,12 @@ lseek(fd, offset, whence) off_t offset; int whence; { - extern off_t __syscall(); off_t retval; if (_FD_LOCK(fd, FD_RDWR, NULL) != 0) { retval = -1; } else { - retval = __syscall((quad_t)SYS_lseek, fd, 0, offset, whence); + retval = __syscall(SYS_lseek, fd, 0, offset, whence); _FD_UNLOCK(fd, FD_RDWR); } return retval; diff --git a/lib/libc/sys/mmap.c b/lib/libc/sys/mmap.c index 2debc8d2186..a97ae570ef1 100644 --- a/lib/libc/sys/mmap.c +++ b/lib/libc/sys/mmap.c @@ -32,16 +32,13 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: mmap.c,v 1.8 1998/01/02 05:32:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mmap.c,v 1.9 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> #include <sys/mman.h> #include <sys/syscall.h> - -#ifdef lint -quad_t __syscall(quad_t, ...); -#endif +#include <unistd.h> /* * This function provides 64-bit offset padding that @@ -57,6 +54,6 @@ mmap(addr, len, prot, flags, fd, offset) off_t offset; { - return((void *)(long)__syscall((quad_t)SYS_mmap, addr, len, prot, + return((void *)(long)__syscall(SYS_mmap, addr, len, prot, flags, fd, 0, offset)); } diff --git a/lib/libc/sys/pread.c b/lib/libc/sys/pread.c index f9e7ac0de0f..d617ad095e2 100644 --- a/lib/libc/sys/pread.c +++ b/lib/libc/sys/pread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pread.c,v 1.2 2001/05/05 22:58:29 millert Exp $ */ +/* $OpenBSD: pread.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */ /* * Copyright (c) 1992, 1993 @@ -34,7 +34,7 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: pread.c,v 1.2 2001/05/05 22:58:29 millert Exp $"; +static char rcsid[] = "$OpenBSD: pread.c,v 1.3 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> @@ -52,11 +52,10 @@ pread(fd, buf, nbyte, offset) size_t nbyte; off_t offset; { - extern off_t __syscall(); quad_t q; int rv; - q = __syscall((quad_t)SYS_pread, fd, buf, nbyte, 0, offset); + q = __syscall(SYS_pread, fd, buf, nbyte, 0, offset); if (/* LINTED constant */ sizeof (quad_t) == sizeof (register_t) || /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN) rv = (int)q; diff --git a/lib/libc/sys/preadv.c b/lib/libc/sys/preadv.c index 99a3dfecfd0..84da9271016 100644 --- a/lib/libc/sys/preadv.c +++ b/lib/libc/sys/preadv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: preadv.c,v 1.2 2001/05/05 22:58:29 millert Exp $ */ +/* $OpenBSD: preadv.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */ /* * Copyright (c) 1992, 1993 @@ -34,7 +34,7 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: preadv.c,v 1.2 2001/05/05 22:58:29 millert Exp $"; +static char rcsid[] = "$OpenBSD: preadv.c,v 1.3 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> @@ -53,11 +53,10 @@ preadv(fd, iovp, iovcnt, offset) int iovcnt; off_t offset; { - extern off_t __syscall(); quad_t q; int rv; - q = __syscall((quad_t)SYS_preadv, fd, iovp, iovcnt, 0, offset); + q = __syscall(SYS_preadv, fd, iovp, iovcnt, 0, offset); if (/* LINTED constant */ sizeof (quad_t) == sizeof (register_t) || /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN) rv = (int)q; diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwrite.c index aae8319c102..c26ed9d1b40 100644 --- a/lib/libc/sys/pwrite.c +++ b/lib/libc/sys/pwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pwrite.c,v 1.2 2001/05/05 22:58:30 millert Exp $ */ +/* $OpenBSD: pwrite.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */ /* * Copyright (c) 1992, 1993 @@ -34,7 +34,7 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: pwrite.c,v 1.2 2001/05/05 22:58:30 millert Exp $"; +static char rcsid[] = "$OpenBSD: pwrite.c,v 1.3 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> @@ -52,11 +52,10 @@ pwrite(fd, buf, nbyte, offset) size_t nbyte; off_t offset; { - extern off_t __syscall(); quad_t q; int rv; - q = __syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset); + q = __syscall(SYS_pwrite, fd, buf, nbyte, 0, offset); if (/* LINTED constant */ sizeof (quad_t) == sizeof (register_t) || /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN) rv = (int)q; diff --git a/lib/libc/sys/pwritev.c b/lib/libc/sys/pwritev.c index ec700195851..13a05fcba65 100644 --- a/lib/libc/sys/pwritev.c +++ b/lib/libc/sys/pwritev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pwritev.c,v 1.2 2001/05/05 22:58:30 millert Exp $ */ +/* $OpenBSD: pwritev.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */ /* * Copyright (c) 1992, 1993 @@ -34,7 +34,7 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: pwritev.c,v 1.2 2001/05/05 22:58:30 millert Exp $"; +static char rcsid[] = "$OpenBSD: pwritev.c,v 1.3 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> @@ -53,11 +53,10 @@ pwritev(fd, iovp, iovcnt, offset) int iovcnt; off_t offset; { - extern off_t __syscall(); quad_t q; int rv; - q = __syscall((quad_t)SYS_pwritev, fd, iovp, iovcnt, 0, offset); + q = __syscall(SYS_pwritev, fd, iovp, iovcnt, 0, offset); if (/* LINTED constant */ sizeof (quad_t) == sizeof (register_t) || /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN) rv = (int)q; diff --git a/lib/libc/sys/truncate.c b/lib/libc/sys/truncate.c index cf3f2970bf3..6c42edc4ff5 100644 --- a/lib/libc/sys/truncate.c +++ b/lib/libc/sys/truncate.c @@ -32,15 +32,12 @@ */ #if defined(SYSLIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: truncate.c,v 1.6 1997/04/26 08:50:13 tholo Exp $"; +static char rcsid[] = "$OpenBSD: truncate.c,v 1.7 2002/09/17 12:57:50 mickey Exp $"; #endif /* SYSLIBC_SCCS and not lint */ #include <sys/types.h> #include <sys/syscall.h> - -#ifdef lint -quad_t __syscall(quad_t, ...); -#endif +#include <unistd.h> /* * This function provides 64-bit offset padding that @@ -52,5 +49,5 @@ truncate(path, length) off_t length; { - return(__syscall((quad_t)SYS_truncate, path, 0, length)); + return(__syscall(SYS_truncate, path, 0, length)); } |