summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/truncate.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-11 13:26:20 +0000
committerguenther <guenther@openbsd.org>2015-09-11 13:26:20 +0000
commitb33a8d55775a3013157d6b0e3602c1fe178b48a6 (patch)
tree935665adf62f21c4312d7dacb69c2c7c808759f8 /lib/libc/sys/truncate.c
parent!= -> == that I broke while bikeshedding (diff)
downloadwireguard-openbsd-b33a8d55775a3013157d6b0e3602c1fe178b48a6.tar.xz
wireguard-openbsd-b33a8d55775a3013157d6b0e3602c1fe178b48a6.zip
Use PROTO_NORMAL() on __syscall to go direct, adjusting the declaration
to eliminate some casts. Retire some uses of old-style STUB* macros where superseded by namespace.h bits tweaks and ok deraadt@
Diffstat (limited to 'lib/libc/sys/truncate.c')
-rw-r--r--lib/libc/sys/truncate.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/libc/sys/truncate.c b/lib/libc/sys/truncate.c
index 6516136672f..3b0adf685d2 100644
--- a/lib/libc/sys/truncate.c
+++ b/lib/libc/sys/truncate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: truncate.c,v 1.13 2011/10/16 06:29:56 guenther Exp $ */
+/* $OpenBSD: truncate.c,v 1.14 2015/09/11 13:26:20 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,24 +28,22 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
-#include "thread_private.h"
-register_t __syscall(quad_t, ...);
+int __syscall(quad_t, ...);
+PROTO_NORMAL(__syscall);
-STUB_PROTOTYPE(truncate);
+DEF_SYS(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
-STUB_NAME(truncate)(const char *path, off_t length)
+truncate(const char *path, off_t length)
{
-
- return(__syscall((quad_t)SYS_truncate, path, 0, length));
+ return (__syscall(SYS_truncate, path, 0, length));
}
+DEF_WEAK(truncate);