summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-09-17 21:15:58 +0000
committerderaadt <deraadt@openbsd.org>2002-09-17 21:15:58 +0000
commitf959b93e603007185f5289f88af72627053e53b4 (patch)
tree462c90d77387c706bb1dbfbc03a2df8c01d10f66 /lib/libc
parentAllow user to restrict logs to be rotated by specifying pathnames on (diff)
downloadwireguard-openbsd-f959b93e603007185f5289f88af72627053e53b4.tar.xz
wireguard-openbsd-f959b93e603007185f5289f88af72627053e53b4.zip
uncommit, since it breaks macppc libc. millert and miod have now said they
did NOT approve those for commit. why did mickey feel he was ok to go commiting a set of diffs which had not been passed around and tested by people? we don't know. mickey, have you got something to say for yourself?
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/ftruncate.c9
-rw-r--r--lib/libc/sys/lseek.c6
-rw-r--r--lib/libc/sys/mmap.c9
-rw-r--r--lib/libc/sys/pread.c7
-rw-r--r--lib/libc/sys/preadv.c7
-rw-r--r--lib/libc/sys/pwrite.c7
-rw-r--r--lib/libc/sys/pwritev.c7
-rw-r--r--lib/libc/sys/truncate.c9
8 files changed, 37 insertions, 24 deletions
diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c
index 34da96b077f..c57c6a0b8b1 100644
--- a/lib/libc/sys/ftruncate.c
+++ b/lib/libc/sys/ftruncate.c
@@ -32,14 +32,17 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ftruncate.c,v 1.8 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ftruncate.c,v 1.9 2002/09/17 21:16:01 deraadt 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.
@@ -54,7 +57,7 @@ ftruncate(fd, length)
if (_FD_LOCK(fd, FD_RDWR, NULL) != 0) {
retval = -1;
} else {
- retval = __syscall(SYS_ftruncate, fd, 0, length);
+ retval = __syscall((quad_t)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 c94d2c5689f..6d5e42d97bd 100644
--- a/lib/libc/sys/lseek.c
+++ b/lib/libc/sys/lseek.c
@@ -32,12 +32,11 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: lseek.c,v 1.7 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: lseek.c,v 1.8 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/syscall.h>
-#include <unistd.h>
#include "thread_private.h"
/*
@@ -50,12 +49,13 @@ 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(SYS_lseek, fd, 0, offset, whence);
+ retval = __syscall((quad_t)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 a97ae570ef1..cfcfe2fdbd8 100644
--- a/lib/libc/sys/mmap.c
+++ b/lib/libc/sys/mmap.c
@@ -32,13 +32,16 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: mmap.c,v 1.9 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: mmap.c,v 1.10 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/syscall.h>
-#include <unistd.h>
+
+#ifdef lint
+quad_t __syscall(quad_t, ...);
+#endif
/*
* This function provides 64-bit offset padding that
@@ -54,6 +57,6 @@ mmap(addr, len, prot, flags, fd, offset)
off_t offset;
{
- return((void *)(long)__syscall(SYS_mmap, addr, len, prot,
+ return((void *)(long)__syscall((quad_t)SYS_mmap, addr, len, prot,
flags, fd, 0, offset));
}
diff --git a/lib/libc/sys/pread.c b/lib/libc/sys/pread.c
index d617ad095e2..97416e5b6be 100644
--- a/lib/libc/sys/pread.c
+++ b/lib/libc/sys/pread.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pread.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */
+/* $OpenBSD: pread.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -34,7 +34,7 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: pread.c,v 1.3 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: pread.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
@@ -52,10 +52,11 @@ pread(fd, buf, nbyte, offset)
size_t nbyte;
off_t offset;
{
+ extern off_t __syscall();
quad_t q;
int rv;
- q = __syscall(SYS_pread, fd, buf, nbyte, 0, offset);
+ q = __syscall((quad_t)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 84da9271016..1a814e7bb81 100644
--- a/lib/libc/sys/preadv.c
+++ b/lib/libc/sys/preadv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: preadv.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */
+/* $OpenBSD: preadv.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -34,7 +34,7 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: preadv.c,v 1.3 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: preadv.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
@@ -53,10 +53,11 @@ preadv(fd, iovp, iovcnt, offset)
int iovcnt;
off_t offset;
{
+ extern off_t __syscall();
quad_t q;
int rv;
- q = __syscall(SYS_preadv, fd, iovp, iovcnt, 0, offset);
+ q = __syscall((quad_t)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 c26ed9d1b40..6099148f81a 100644
--- a/lib/libc/sys/pwrite.c
+++ b/lib/libc/sys/pwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwrite.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */
+/* $OpenBSD: pwrite.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -34,7 +34,7 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: pwrite.c,v 1.3 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: pwrite.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
@@ -52,10 +52,11 @@ pwrite(fd, buf, nbyte, offset)
size_t nbyte;
off_t offset;
{
+ extern off_t __syscall();
quad_t q;
int rv;
- q = __syscall(SYS_pwrite, fd, buf, nbyte, 0, offset);
+ q = __syscall((quad_t)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 13a05fcba65..83ca9be018f 100644
--- a/lib/libc/sys/pwritev.c
+++ b/lib/libc/sys/pwritev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwritev.c,v 1.3 2002/09/17 12:57:50 mickey Exp $ */
+/* $OpenBSD: pwritev.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -34,7 +34,7 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: pwritev.c,v 1.3 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: pwritev.c,v 1.4 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
@@ -53,10 +53,11 @@ pwritev(fd, iovp, iovcnt, offset)
int iovcnt;
off_t offset;
{
+ extern off_t __syscall();
quad_t q;
int rv;
- q = __syscall(SYS_pwritev, fd, iovp, iovcnt, 0, offset);
+ q = __syscall((quad_t)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 6c42edc4ff5..e0c62ed39b3 100644
--- a/lib/libc/sys/truncate.c
+++ b/lib/libc/sys/truncate.c
@@ -32,12 +32,15 @@
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: truncate.c,v 1.7 2002/09/17 12:57:50 mickey Exp $";
+static char rcsid[] = "$OpenBSD: truncate.c,v 1.8 2002/09/17 21:16:01 deraadt Exp $";
#endif /* SYSLIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/syscall.h>
-#include <unistd.h>
+
+#ifdef lint
+quad_t __syscall(quad_t, ...);
+#endif
/*
* This function provides 64-bit offset padding that
@@ -49,5 +52,5 @@ truncate(path, length)
off_t length;
{
- return(__syscall(SYS_truncate, path, 0, length));
+ return(__syscall((quad_t)SYS_truncate, path, 0, length));
}