summaryrefslogtreecommitdiff
path: root/lib/libc/sys/pwrite.c
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2007-11-22 21:11:30 +0000
committerdsl <dsl@NetBSD.org>2007-11-22 21:11:30 +0000
commitb0b7248d927796fbeda167a42fe9bdc2fb5792cd (patch)
treef3cb5ec0ce63a3742230d33c1794d50a62ce65d3 /lib/libc/sys/pwrite.c
parent5dec3ab6673af234eaf1539a73273b4722f3bb13 (diff)
Change all the syscall C 'glue' functions (most of which just add in an
extra argument to ensure that 'off_t' parameters are even numbered parameters for stack alignment reasons on 32 bit systems) to use a normal 'syscall' wrapper for __foo instead of using __syscall(SYS_foo, ... ). This saves all the faffing needed to get a 32bit return value on sparc. Auto-generate the extra syscall wrappers. Move swapon.c into the correct list (swapon() uses swapctl()). This probably means there are very few users of syscall() and __syscall() left.
Diffstat (limited to 'lib/libc/sys/pwrite.c')
-rw-r--r--lib/libc/sys/pwrite.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwrite.c
index 558868e3ff9..2a7b23342ca 100644
--- a/lib/libc/sys/pwrite.c
+++ b/lib/libc/sys/pwrite.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pwrite.c,v 1.8 2006/11/10 17:37:39 christos Exp $ */
+/* $NetBSD: pwrite.c,v 1.9 2007/11/22 21:11:32 dsl Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: pwrite.c,v 1.8 2006/11/10 17:37:39 christos Exp $");
+__RCSID("$NetBSD: pwrite.c,v 1.9 2007/11/22 21:11:32 dsl Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -48,6 +48,7 @@ __weak_alias(_pwrite,_sys_pwrite)
#endif
ssize_t _sys_pwrite(int, const void *, size_t, off_t);
+ssize_t __pwrite(int, const void *, size_t, int, off_t);
/*
* This function provides 64-bit offset padding that
@@ -56,14 +57,6 @@ ssize_t _sys_pwrite(int, const void *, size_t, off_t);
ssize_t
_sys_pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
{
- quad_t q;
- int rv;
- 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;
- else
- rv = (int)((u_quad_t)q >> 32);
- return rv;
+ return __pwrite(fd, buf, nbyte, 0, offset);
}