summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-10-16 06:29:57 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-10-16 06:29:57 +0000
commitc88c9da9de80c953720b63f23dfe9904e3792861 (patch)
treeb6831173c0658dcb35f5c809fa0b00542d700a79 /lib/libc/sys
parent2a45f95d13665d24e0b297ff465f09d691dfb1bf (diff)
Make consistent the syscall stubs for the syscalls that got special
handling to fix up the alignment of 64bit arguments so that they do the same dance where _thread_sys_FOO is the real stub and FOO is a weak alias. For some of them, this is needed for cancellation handling. From discussions with fgsch@, ok millert@
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/ftruncate.c8
-rw-r--r--lib/libc/sys/lseek.c8
-rw-r--r--lib/libc/sys/mmap.c10
-rw-r--r--lib/libc/sys/mquery.c10
-rw-r--r--lib/libc/sys/pread.c11
-rw-r--r--lib/libc/sys/preadv.c11
-rw-r--r--lib/libc/sys/pwrite.c11
-rw-r--r--lib/libc/sys/pwritev.c11
-rw-r--r--lib/libc/sys/truncate.c9
9 files changed, 67 insertions, 22 deletions
diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c
index d0f5e9837c4..38a5a5079e4 100644
--- a/lib/libc/sys/ftruncate.c
+++ b/lib/libc/sys/ftruncate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftruncate.c,v 1.15 2007/06/05 18:11:48 kurt Exp $ */
+/* $OpenBSD: ftruncate.c,v 1.16 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,16 +36,16 @@ register_t __syscall(quad_t, ...);
/* ftruncate is weak to support libpthread locking */
-WEAK_PROTOTYPE(ftruncate);
+STUB_PROTOTYPE(ftruncate);
-WEAK_ALIAS(ftruncate);
+STUB_ALIAS(ftruncate);
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
int
-WEAK_NAME(ftruncate)(int fd, off_t length)
+STUB_NAME(ftruncate)(int fd, off_t length)
{
return (__syscall((quad_t)SYS_ftruncate, fd, 0, length));
}
diff --git a/lib/libc/sys/lseek.c b/lib/libc/sys/lseek.c
index 1abb688a348..51d0676356a 100644
--- a/lib/libc/sys/lseek.c
+++ b/lib/libc/sys/lseek.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lseek.c,v 1.14 2007/06/05 18:11:48 kurt Exp $ */
+/* $OpenBSD: lseek.c,v 1.15 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,16 +36,16 @@ off_t __syscall(quad_t, ...);
/* lseek is weak to support libpthread locking */
-WEAK_PROTOTYPE(lseek);
+STUB_PROTOTYPE(lseek);
-WEAK_ALIAS(lseek);
+STUB_ALIAS(lseek);
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
off_t
-WEAK_NAME(lseek)(int fd, off_t offset, int whence)
+STUB_NAME(lseek)(int fd, off_t offset, int whence)
{
return (__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
}
diff --git a/lib/libc/sys/mmap.c b/lib/libc/sys/mmap.c
index 19ec915d7cc..2ef5baa5413 100644
--- a/lib/libc/sys/mmap.c
+++ b/lib/libc/sys/mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmap.c,v 1.14 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: mmap.c,v 1.15 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,15 +31,21 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+STUB_PROTOTYPE(mmap);
+
+STUB_ALIAS(mmap);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
void *
-mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
+STUB_NAME(mmap)(void *addr, size_t len, int prot, int flags, int fd,
+ off_t offset)
{
return((void *)__syscall((quad_t)SYS_mmap, addr, len, prot,
diff --git a/lib/libc/sys/mquery.c b/lib/libc/sys/mquery.c
index d22ce89ad26..53b27f971de 100644
--- a/lib/libc/sys/mquery.c
+++ b/lib/libc/sys/mquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mquery.c,v 1.6 2005/04/06 16:56:45 millert Exp $ */
+/* $OpenBSD: mquery.c,v 1.7 2011/10/16 06:29:56 guenther Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> Public Domain
*/
@@ -6,14 +6,20 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+STUB_PROTOTYPE(mquery);
+
+STUB_ALIAS(mquery);
+
/*
* This function provides 64-bit offset padding.
*/
void *
-mquery(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
+STUB_NAME(mquery)(void *addr, size_t len, int prot, int flags, int fd,
+ off_t offset)
{
return((void *)__syscall((quad_t)SYS_mquery, addr, len, prot,
flags, fd, 0, offset));
diff --git a/lib/libc/sys/pread.c b/lib/libc/sys/pread.c
index 39cedfada10..6338e14dba9 100644
--- a/lib/libc/sys/pread.c
+++ b/lib/libc/sys/pread.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pread.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: pread.c,v 1.9 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -32,15 +32,22 @@
#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+/* pread is weak to support libpthread cancellation */
+
+STUB_PROTOTYPE(pread);
+
+STUB_ALIAS(pread);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
ssize_t
-pread(int fd, void *buf, size_t nbyte, off_t offset)
+STUB_NAME(pread)(int fd, void *buf, size_t nbyte, off_t offset)
{
return (__syscall((quad_t)SYS_pread, fd, buf, nbyte, 0, offset));
diff --git a/lib/libc/sys/preadv.c b/lib/libc/sys/preadv.c
index b39e30c3227..238364ddd75 100644
--- a/lib/libc/sys/preadv.c
+++ b/lib/libc/sys/preadv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: preadv.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: preadv.c,v 1.9 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -33,15 +33,22 @@
#include <sys/syscall.h>
#include <sys/uio.h>
#include <unistd.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+/* preadv is weak to support libpthread cancellation */
+
+STUB_PROTOTYPE(preadv);
+
+STUB_ALIAS(preadv);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
ssize_t
-preadv(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
+STUB_NAME(preadv)(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
{
return (__syscall((quad_t)SYS_preadv, fd, iovp, iovcnt, 0, offset));
diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwrite.c
index b49d2fdbd55..8757bf9a272 100644
--- a/lib/libc/sys/pwrite.c
+++ b/lib/libc/sys/pwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwrite.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: pwrite.c,v 1.9 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -32,15 +32,22 @@
#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+/* pread is weak to support libpthread cancellation */
+
+STUB_PROTOTYPE(pwrite);
+
+STUB_ALIAS(pwrite);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
ssize_t
-pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
+STUB_NAME(pwrite)(int fd, const void *buf, size_t nbyte, off_t offset)
{
return (__syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset));
diff --git a/lib/libc/sys/pwritev.c b/lib/libc/sys/pwritev.c
index 31192152376..345d3831965 100644
--- a/lib/libc/sys/pwritev.c
+++ b/lib/libc/sys/pwritev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwritev.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: pwritev.c,v 1.9 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -33,15 +33,22 @@
#include <sys/syscall.h>
#include <sys/uio.h>
#include <unistd.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+/* pwritev is weak to support libpthread cancellation */
+
+STUB_PROTOTYPE(pwritev);
+
+STUB_ALIAS(pwritev);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
ssize_t
-pwritev(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
+STUB_NAME(pwritev)(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
{
return (__syscall((quad_t)SYS_pwritev, fd, iovp, iovcnt, 0, offset));
diff --git a/lib/libc/sys/truncate.c b/lib/libc/sys/truncate.c
index 960deb6f617..6516136672f 100644
--- a/lib/libc/sys/truncate.c
+++ b/lib/libc/sys/truncate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: truncate.c,v 1.12 2005/08/08 08:05:38 espie Exp $ */
+/* $OpenBSD: truncate.c,v 1.13 2011/10/16 06:29:56 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,15 +31,20 @@
#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
+#include "thread_private.h"
register_t __syscall(quad_t, ...);
+STUB_PROTOTYPE(truncate);
+
+STUB_ALIAS(truncate);
+
/*
* This function provides 64-bit offset padding that
* is not supplied by GCC 1.X but is supplied by GCC 2.X.
*/
int
-truncate(const char *path, off_t length)
+STUB_NAME(truncate)(const char *path, off_t length)
{
return(__syscall((quad_t)SYS_truncate, path, 0, length));