summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-17 21:16:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-17 21:16:02 +0000
commit4768505c29990ff01e13044545b29c1fdf9fcd31 (patch)
treeceb4510af8f14eab9795ee56c59b61875f938981 /lib
parent87ca0d033f283587c2220d51ccbe048f9201eabd (diff)
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')
-rw-r--r--lib/csu/common.h20
-rw-r--r--lib/csu/i386/crt0.c6
-rw-r--r--lib/csu/m68k/crt0.c6
-rw-r--r--lib/csu/vax/crt0.c6
-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
12 files changed, 56 insertions, 43 deletions
diff --git a/lib/csu/common.h b/lib/csu/common.h
index fbde48343c8..596b7cff5e7 100644
--- a/lib/csu/common.h
+++ b/lib/csu/common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.h,v 1.5 2002/09/17 12:53:44 mickey Exp $ */
+/* $OpenBSD: common.h,v 1.6 2002/09/17 21:16:01 deraadt Exp $ */
/* $NetBSD: common.h,v 1.3 1995/06/15 21:41:48 pk Exp $ */
/*
@@ -52,7 +52,7 @@
extern struct _dynamic _DYNAMIC;
static void __load_rtld(struct _dynamic *);
-extern int __syscall2(int, ...);
+extern int __syscall(int, ...);
int _callmain(void);
static char *_strrchr(char *, char);
#ifdef DEBUG
@@ -65,15 +65,15 @@ static int _strncmp(char *, char *, int);
/*
* We need these system calls, but can't use library stubs
*/
-#define _exit(v) __syscall2(SYS_exit, (v))
-#define open(name, f, m) __syscall2(SYS_open, (name), (f), (m))
-#define close(fd) __syscall2(SYS_close, (fd))
-#define read(fd, s, n) __syscall2(SYS_read, (fd), (s), (n))
-#define write(fd, s, n) __syscall2(SYS_write, (fd), (s), (n))
-#define dup(fd) __syscall2(SYS_dup, (fd))
-#define dup2(fd, fdnew) __syscall2(SYS_dup2, (fd), (fdnew))
+#define _exit(v) __syscall(SYS_exit, (v))
+#define open(name, f, m) __syscall(SYS_open, (name), (f), (m))
+#define close(fd) __syscall(SYS_close, (fd))
+#define read(fd, s, n) __syscall(SYS_read, (fd), (s), (n))
+#define write(fd, s, n) __syscall(SYS_write, (fd), (s), (n))
+#define dup(fd) __syscall(SYS_dup, (fd))
+#define dup2(fd, fdnew) __syscall(SYS_dup2, (fd), (fdnew))
#define mmap(addr, len, prot, flags, fd, off) \
- __syscall2(SYS___syscall, (quad_t)SYS_mmap, (addr), (len), (prot), (flags), \
+ __syscall(SYS___syscall, (quad_t)SYS_mmap, (addr), (len), (prot), (flags), \
(fd), 0, (off_t)(off))
#define _FATAL(str) \
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c
index d3408768d6d..19390e7c840 100644
--- a/lib/csu/i386/crt0.c
+++ b/lib/csu/i386/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.7 2002/09/17 12:53:44 mickey Exp $ */
+/* $OpenBSD: crt0.c,v 1.8 2002/09/17 21:16:01 deraadt Exp $ */
/* $NetBSD: crt0.c,v 1.20 1995/06/03 13:16:08 pk Exp $ */
/*
@@ -34,7 +34,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: crt0.c,v 1.7 2002/09/17 12:53:44 mickey Exp $";
+static char rcsid[] = "$OpenBSD: crt0.c,v 1.8 2002/09/17 21:16:01 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -98,7 +98,7 @@ asm ("__callmain:"); /* Defined for the benefit of debuggers */
}
#ifdef DYNAMIC
- asm(" ___syscall2:");
+ asm(" ___syscall:");
asm(" popl %ecx");
asm(" popl %eax");
asm(" pushl %ecx");
diff --git a/lib/csu/m68k/crt0.c b/lib/csu/m68k/crt0.c
index 8cb885e162e..9484cf5e7cf 100644
--- a/lib/csu/m68k/crt0.c
+++ b/lib/csu/m68k/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.6 2002/09/17 12:53:44 mickey Exp $ */
+/* $OpenBSD: crt0.c,v 1.7 2002/09/17 21:16:01 deraadt Exp $ */
/* $NetBSD: crt0.c,v 1.14 1995/06/03 13:16:11 pk Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: crt0.c,v 1.6 2002/09/17 12:53:44 mickey Exp $";
+static char rcsid[] = "$OpenBSD: crt0.c,v 1.7 2002/09/17 21:16:01 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -95,7 +95,7 @@ asm ("__callmain:"); /* Defined for the benefit of debuggers */
}
#ifdef DYNAMIC
- asm(" ___syscall2:");
+ asm(" ___syscall:");
asm(" movel a7@+,a0"); /* return address */
asm(" movel a7@,d0"); /* syscall number */
asm(" movel a0,a7@");
diff --git a/lib/csu/vax/crt0.c b/lib/csu/vax/crt0.c
index b9bbbc05f43..9881dbb69f2 100644
--- a/lib/csu/vax/crt0.c
+++ b/lib/csu/vax/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.6 2002/09/17 12:53:44 mickey Exp $ */
+/* $OpenBSD: crt0.c,v 1.7 2002/09/17 21:16:01 deraadt Exp $ */
/* $NetBSD: crt0.c,v 1.1.2.1 1995/10/15 19:40:04 ragge Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: crt0.c,v 1.6 2002/09/17 12:53:44 mickey Exp $";
+static char rcsid[] = "$OpenBSD: crt0.c,v 1.7 2002/09/17 21:16:01 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -96,7 +96,7 @@ asm ("__callmain:"); /* Defined for the benefit of debuggers */
}
#ifdef DYNAMIC
- asm(" ___syscall2:");
+ asm(" ___syscall:");
asm(" .word 0"); /* no registers to save */
asm(" movl 4(ap), r0"); /* get syscall number */
asm(" subl3 $1,(ap)+,(ap)"); /* n-1 args to syscall */
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));
}