about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-21 15:29:52 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-21 15:29:52 +0000
commit0dee67386c1ef99baee307ab01d20c79739cbc2a (patch)
tree1acb6c95fc9c50e0e13312a564b1bab44f1d13cb /sysdeps/unix
parent6c6270e0a91140a5bb4a76ebfd2681067592aaf8 (diff)
downloadglibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.tar.gz
glibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.tar.xz
glibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.zip
Update.
1998-10-21 14:38  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysdep.h (INLINE_SYSCALL): New macro.  Simply call
	__syscall_* function.
	* sysdeps/unix/sysv/linux/aio_sigqueue.c: Use INLINE_SYSCALL instead
	of calling __syscall_* function.
	* sysdeps/unix/sysv/linux/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/getcwd.c: Likewise.
	* sysdeps/unix/sysv/linux/getdents.c: Likewise.
	* sysdeps/unix/sysv/linux/getpriority.c: Likewise.
	* sysdeps/unix/sysv/linux/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/poll.c: Likewise.
	* sysdeps/unix/sysv/linux/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/ptrace.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	* sysdeps/unix/sysv/linux/reboot.c: Likewise.
	* sysdeps/unix/sysv/linux/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/siglist.h: Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
	* sysdeps/unix/sysv/linux/sigqueue.c: Likewise.
	* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
	* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
	* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sysctl.c: Likewise.
	* sysdeps/unix/sysv/linux/ustat.c: Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
	* sysdeps/unix/sysv/linux/xmknod.c: Likewise.
	* sysdeps/unix/sysv/linux/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.

	* sysdeps/unix/sysv/linux/i386/sysdep.h: Define INLINE_SYSCALL using
	inline assembler.
	* sysdeps/unix/sysv/linux/i386/syscalls.list: Remove various
	__syscall_* definitions.

	* sysdeps/unix/sysv/linux/syscalls.list: Move various __syscall_*
	definitions to...
	* sysdeps/unix/sysv/linux/alpha/syscalls.list: ...here...
	* sysdeps/unix/sysv/linux/arm/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/mips/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/powerpc/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: ...and here.

	* sysdeps/unix/sysv/linux/i386/Makefile [subdir=misc]
	(sysdep_routines): Remove s_pread64 and s_pwrite64.

	* sysdeps/unix/sysv/linux/i386/pread.c: New file.
	* sysdeps/unix/sysv/linux/i386/pread64.c: New file.
	* sysdeps/unix/sysv/linux/i386/pwrite.c: New file.
	* sysdeps/unix/sysv/linux/i386/pwrite64.c: New file.
	* sysdeps/unix/sysv/linux/i386/s_pread64.S: Removed.
	* sysdeps/unix/sysv/linux/i386/s_pwrite64.S: Removed.

1998-10-21  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/siglist.h: Fix some typos in these files
	and bring them in synch.
	* sysdeps/unix/siglist.c: Likewise.
	Reported by Vladimir Michl <michlv@risc.upol.cz> [PR libc/832].

1998-10-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/i386/setresuid.c: Allow -1 as arguments.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.

	* sysdeps/unix/sysv/linux/i386/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setregid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setregid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setregid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c: New file.
	* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_setreuid and
	s_setregid.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.

1998-10-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* sunrpc/rpc_main.c (close_output, close_input): New functions.
	(c_output, h_output, s_output, l_output, t_output, svc_output,
	clnt_output, mkfile_output): Call them at the end.

1998-10-19  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* db/Makefile (LDFLAGS-db1.so): New variable, to avoid duplicating
	link command.

1998-10-18  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* sysdeps/unix/opendir.c: Check at runtime for kernel support for
	O_DIRECTORY.

1998-10-20  H.J. Lu  <hjl@gnu.org>

	* sysdeps/unix/sysv/linux/i386/setresuid.c (__setresuid): Fix
	argument types.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/siglist.c6
-rw-r--r--sysdeps/unix/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/aio_sigqueue.c6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list30
-rw-r--r--sysdeps/unix/sysv/linux/arm/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list32
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c11
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c7
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c4
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c12
-rw-r--r--sysdeps/unix/sysv/linux/getpriority.c7
-rw-r--r--sysdeps/unix/sysv/linux/getresgid.c18
-rw-r--r--sysdeps/unix/sysv/linux/getresuid.c18
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile3
-rw-r--r--sysdeps/unix/sysv/linux/i386/chown.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/getgroups.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/pread.c55
-rw-r--r--sysdeps/unix/sysv/linux/i386/pread64.c60
-rw-r--r--sysdeps/unix/sysv/linux/i386/pwrite.c55
-rw-r--r--sysdeps/unix/sysv/linux/i386/pwrite64.c57
-rw-r--r--sysdeps/unix/sysv/linux/i386/s_pread64.S55
-rw-r--r--sysdeps/unix/sysv/linux/i386/s_pwrite64.S55
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsgid.c15
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsuid.c15
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgid.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgroups.c10
-rw-r--r--sysdeps/unix/sysv/linux/i386/setregid.c42
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresgid.c9
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresuid.c9
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c42
-rw-r--r--sysdeps/unix/sysv/linux/i386/setuid.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list9
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c11
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c7
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscalls.list32
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list26
-rw-r--r--sysdeps/unix/sysv/linux/poll.c17
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/syscalls.list30
-rw-r--r--sysdeps/unix/sysv/linux/pread.c4
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c6
-rw-r--r--sysdeps/unix/sysv/linux/ptrace.c20
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c4
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c6
-rw-r--r--sysdeps/unix/sysv/linux/readv.c7
-rw-r--r--sysdeps/unix/sysv/linux/reboot.c8
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c11
-rw-r--r--sysdeps/unix/sysv/linux/siglist.h2
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c7
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c8
-rw-r--r--sysdeps/unix/sysv/linux/sigqueue.c6
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c7
-rw-r--r--sysdeps/unix/sysv/linux/sigtimedwait.c8
-rw-r--r--sysdeps/unix/sysv/linux/sigwaitinfo.c6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list32
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list30
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list28
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c9
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c7
-rw-r--r--sysdeps/unix/sysv/linux/writev.c7
-rw-r--r--sysdeps/unix/sysv/linux/xmknod.c7
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c11
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c7
67 files changed, 767 insertions, 286 deletions
diff --git a/sysdeps/unix/siglist.c b/sysdeps/unix/siglist.c
index 53776b5a42..942f7647ab 100644
--- a/sysdeps/unix/siglist.c
+++ b/sysdeps/unix/siglist.c
@@ -27,7 +27,7 @@ const char *const _sys_siglist[] =
     N_("Interrupt"),
     N_("Quit"),
     N_("Illegal instruction"),
-    N_("Trace/BPT trap"),
+    N_("Trace/breakpoint trap"),
     N_("IOT trap"),
     N_("EMT trap"),
     N_("Floating point exception"),
@@ -46,8 +46,8 @@ const char *const _sys_siglist[] =
     N_("Stopped (tty input)"),
     N_("Stopped (tty output)"),
     N_("I/O possible"),
-    N_("Cputime limit exceeded"),
-    N_("Filesize limit exceeded"),
+    N_("CPU time limit exceeded"),
+    N_("File size limit exceeded"),
     N_("Virtual timer expired"),
     N_("Profiling timer expired"),
     N_("Window changed"),
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index dc8c0b34d2..e56e30ea88 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 96, 98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,3 +47,7 @@
 #ifndef PSEUDO_END
 #define PSEUDO_END(sym)
 #endif
+
+/* Wrappers around system calls should normally inline the system call code.
+   But sometimes it is not possible or implemented and we use this code.  */
+#define INLINE_SYSCALL(name, nr, args...) __syscall_##name (args)
diff --git a/sysdeps/unix/sysv/linux/aio_sigqueue.c b/sysdeps/unix/sysv/linux/aio_sigqueue.c
index 5dea29fcf6..8d1d5cf321 100644
--- a/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -17,9 +17,13 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <aio.h>
+#include <errno.h>
 #include <signal.h>
 #include <unistd.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include "aio_misc.h"
 
 extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *);
@@ -41,5 +45,5 @@ __aio_sigqueue (sig, val)
   info.si_uid = getuid ();
   info.si_value = val;
 
-  return __syscall_rt_sigqueueinfo (info.si_pid, sig, &info);
+  return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
 }
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 9f002b2ad1..5d89ccbd53 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -79,3 +79,33 @@ old_adjtimex	-	old_adjtimex	1	__adjtimex_tv32  __adjtimex@GLIBC_2.0 adjtimex@GLI
 
 # and one for timeval64 entry points
 adjtimex	adjtime	adjtimex	1	__syscall_adjtimex_tv64
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/arm/setregid.c b/sysdeps/unix/sysv/linux/arm/setregid.c
new file mode 100644
index 0000000000..99c57ad20f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setregid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setreuid.c b/sysdeps/unix/sysv/linux/arm/setreuid.c
new file mode 100644
index 0000000000..8ad61226e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setreuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index e3fe1d7b8d..b89badf831 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -6,8 +6,40 @@ s_setfsgid	setfsgid setfsgid	1	__syscall_setfsgid
 s_setfsuid	setfsuid setfsuid	1	__syscall_setfsuid
 s_setgid	setgid	setgid		1	__syscall_setgid
 s_setgroups	setgroups setgroups	2	__syscall_setgroups
+s_setregid	setregid setregid	2	__syscall_setregid
 s_setresgid	setresgid setresgid	3	__syscall_setresgid
 s_setresuid	setresuid setresuid	3	__syscall_setresuid
+s_setreuid	setreuid setreuid	2	__syscall_setreuid
 s_setuid	setuid	setuid		1	__syscall_setuid
 syscall		-	syscall		5	syscall
 vm86		-	vm86		1	__vm86		vm86
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index afed300267..99074f9d77 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -1,5 +1,5 @@
 /* fxstat using old-style Unix fstat system call.
-   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_fstat (int, struct kernel_stat *);
@@ -38,9 +41,11 @@ __fxstat (int vers, int fd, struct stat *buf)
   int result;
 
   if (vers == _STAT_VER_KERNEL)
-    return __syscall_fstat (fd, (struct kernel_stat *) buf);
+    {
+      return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf);
+    }
 
-  result =  __syscall_fstat (fd, &kbuf);
+  result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
   if (result == 0)
     result = xstat_conv (vers, &kbuf, buf);
 
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index f6884998c7..5f13fbe35c 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -1,5 +1,5 @@
 /* fxstat64 using old-style Unix fstat system call.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_fstat (int, struct kernel_stat *);
@@ -33,7 +36,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
   struct kernel_stat kbuf;
   int result;
 
-  result =  __syscall_fstat (fd, &kbuf);
+  result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
   if (result == 0)
     result = xstat64_conv (vers, &kbuf, buf);
 
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 19a2c0f257..bbe21d627f 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -22,6 +22,8 @@
 #include <limits.h>
 #include <stdlib.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 
@@ -83,7 +85,7 @@ __getcwd (char *buf, size_t size)
     {
       int retval;
 
-      retval = __syscall_getcwd (path, alloc_size);
+      retval = INLINE_SYSCALL (getcwd, 2, path, alloc_size);
       if (retval >= 0)
 	{
 	  if (buf == NULL)
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index f253878e8b..b59acc0e1c 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <alloca.h>
+#include <errno.h>
 #include <dirent.h>
 #include <stddef.h>
 #include <string.h>
@@ -24,19 +25,22 @@
 #include <sys/param.h>
 #include <sys/types.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <linux/posix_types.h>
 
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 
 
-extern int __getdents __P ((int fd, char *buf, size_t nbytes));
+extern int __syscall_getdents __P ((int fd, char *buf, size_t nbytes));
 
 /* For Linux we need a special version of this file since the
    definition of `struct dirent' is not the same for the kernel and
    the libc.  There is one additional field which might be introduced
    in the kernel structure in the future.
 
-   He is the kernel definition of `struct dirent' as of 2.1.20:  */
+   Here is the kernel definition of `struct dirent' as of 2.1.20:  */
 
 struct kernel_dirent
   {
@@ -76,7 +80,7 @@ __getdirentries (int fd, char *buf, size_t nbytes, off_t *basep)
   dp = (struct dirent *) buf;
   skdp = kdp = __alloca (red_nbytes);
 
-  retval = __getdents (fd, (char *) kdp, red_nbytes);
+  retval = INLINE_SYSCALL (getdents, 3, fd, (char *) kdp, red_nbytes);
 
   while ((char *) kdp < (char *) skdp + retval)
     {
diff --git a/sysdeps/unix/sysv/linux/getpriority.c b/sysdeps/unix/sysv/linux/getpriority.c
index dba7cb3b41..9be8d3f70b 100644
--- a/sysdeps/unix/sysv/linux/getpriority.c
+++ b/sysdeps/unix/sysv/linux/getpriority.c
@@ -1,5 +1,5 @@
 /* getpriority for Linux.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -19,6 +19,9 @@
 #include <errno.h>
 #include <sys/resource.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_getpriority (int, int);
 
 /* The return value of __syscall_getpriority is biased by this value
@@ -35,7 +38,7 @@ getpriority (enum __priority_which which, int who)
 {
   int res;
 
-  res = __syscall_getpriority ((int) which, who);
+  res = INLINE_SYSCALL (getpriority, 2, (int) which, who);
   if (res >= 0)
     res = PZERO - res;
   return res;
diff --git a/sysdeps/unix/sysv/linux/getresgid.c b/sysdeps/unix/sysv/linux/getresgid.c
index 4c326d5ba9..475592ead4 100644
--- a/sysdeps/unix/sysv/linux/getresgid.c
+++ b/sysdeps/unix/sysv/linux/getresgid.c
@@ -16,11 +16,13 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 #include <linux/posix_types.h>
 
+#include <sysdep.h>
 #include <sys/syscall.h>
 #ifdef __NR_getresgid
 
@@ -31,14 +33,18 @@ int
 getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
 {
   __kernel_gid_t k_rgid, k_egid, k_sgid;
+  int result;
 
-  if (__syscall_getresgid (&k_rgid, &k_egid, &k_sgid) < 0)
-    return -1;
+  result = INLINE_SYSCALL (getresgid, 3, &k_rgid, &k_egid, &k_sgid);
 
-  *rgid = (gid_t) k_rgid;
-  *egid = (gid_t) k_egid;
-  *sgid = (gid_t) k_sgid;
-  return 0;
+  if (result == 0)
+    {
+      *rgid = (gid_t) k_rgid;
+      *egid = (gid_t) k_egid;
+      *sgid = (gid_t) k_sgid;
+    }
+
+  return result;
 }
 #else
 # include <sysdeps/generic/getresgid.c>
diff --git a/sysdeps/unix/sysv/linux/getresuid.c b/sysdeps/unix/sysv/linux/getresuid.c
index 6b6bc37290..09b12a5e0e 100644
--- a/sysdeps/unix/sysv/linux/getresuid.c
+++ b/sysdeps/unix/sysv/linux/getresuid.c
@@ -16,11 +16,13 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 #include <linux/posix_types.h>
 
+#include <sysdep.h>
 #include <sys/syscall.h>
 #ifdef __NR_getresuid
 
@@ -31,14 +33,18 @@ int
 getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
 {
   __kernel_uid_t k_ruid, k_euid, k_suid;
+  int result;
 
-  if (__syscall_getresuid (&k_ruid, &k_euid, &k_suid) < 0)
-    return -1;
+  result = INLINE_SYSCALL (getresuid, 3, &k_ruid, &k_euid, &k_suid);
 
-  *ruid = (uid_t) k_ruid;
-  *euid = (uid_t) k_euid;
-  *suid = (uid_t) k_suid;
-  return 0;
+  if (result == 0)
+    {
+      *ruid = (uid_t) k_ruid;
+      *euid = (uid_t) k_euid;
+      *suid = (uid_t) k_suid;
+    }
+
+  return result;
 }
 #else
 # include <sysdeps/generic/getresuid.c>
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 29011fd22e..38987e4202 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,6 +1,5 @@
 ifeq ($(subdir),misc)
-sysdep_routines += ioperm iopl vm86 s_pread64 s_pwrite64 setfsgid setfsuid \
-		   setresgid setresuid
+sysdep_routines += ioperm iopl vm86 setfsgid setfsuid setresgid setresuid
 sysdep_headers += sys/elf.h sys/perm.h sys/reg.h sys/vm86.h sys/debugreg.h
 endif
 
diff --git a/sysdeps/unix/sysv/linux/i386/chown.c b/sysdeps/unix/sysv/linux/i386/chown.c
index 9d864d0697..3776a4490c 100644
--- a/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/sysdeps/unix/sysv/linux/i386/chown.c
@@ -18,6 +18,8 @@
 
 #include <errno.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 /*
@@ -45,7 +47,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
   if (!__libc_old_chown)
     {
       int saved_errno = errno;
-      result = __syscall_chown (file, owner, group);
+      result = INLINE_SYSCALL (chown, 3, file, owner, group);
 
       if (result >= 0 || errno != ENOSYS)
 	return result;
@@ -64,7 +66,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
 int
 __chown_is_lchown (const char *file, uid_t owner, gid_t group)
 {
-  return __syscall_chown (file, owner, group);
+  return INLINE_SYSCALL (chown, 3, file, owner, group);
 }
 #elif defined HAVE_ELF && defined PIC && defined DO_VERSIONING
 /* Compiling for compatibiity.  */
diff --git a/sysdeps/unix/sysv/linux/i386/getgroups.c b/sysdeps/unix/sysv/linux/i386/getgroups.c
index 2b8f9575fb..c306dd1268 100644
--- a/sysdeps/unix/sysv/linux/i386/getgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/getgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,9 +16,11 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <sysdep.h>
 #include <linux/posix_types.h>
 
 extern int __syscall_getgroups __P ((int, __kernel_gid_t *));
@@ -33,7 +35,7 @@ __getgroups (n, groups)
   int i, ngids;
   __kernel_gid_t kernel_groups[n];
 
-  ngids = __syscall_getgroups (n, kernel_groups);
+  ngids = INLINE_SYSCALL (getgroups, 2, n, kernel_groups);
   if (n != 0 && ngids > 0)
     for (i = 0; i < ngids; i++)
       groups[i] = kernel_groups[i];
diff --git a/sysdeps/unix/sysv/linux/i386/pread.c b/sysdeps/unix/sysv/linux/i386/pread.c
new file mode 100644
index 0000000000..4c2f18d3f2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/pread.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_pread
+
+static ssize_t __emulate_pread (int fd, void *buf, size_t count,
+				off_t offset) internal_function;
+
+
+ssize_t
+__pread (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count, offset, 0);
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pread (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pread, pread)
+
+#define __pread(fd, buf, count, offset) \
+     static internal_function __emulate_pread (fd, buf, count, offset)
+#endif
+#include <sysdeps/posix/pread.c>
diff --git a/sysdeps/unix/sysv/linux/i386/pread64.c b/sysdeps/unix/sysv/linux/i386/pread64.c
new file mode 100644
index 0000000000..8cfb3c0a43
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/pread64.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_pread
+
+extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count,
+				  off_t offset_hi, off_t offset_lo);
+
+static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
+				  off64_t offset) internal_function;
+
+
+ssize_t
+__pread64 (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count,
+			   (off_t) (offset & 0xffffffff),
+			   (off_t) (offset >> 32));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pread64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pread64, pread64)
+
+#define __pread64(fd, buf, count, offset) \
+     static internal_function __emulate_pread64 (fd, buf, count, offset)
+#endif
+#include <sysdeps/posix/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/i386/pwrite.c b/sysdeps/unix/sysv/linux/i386/pwrite.c
new file mode 100644
index 0000000000..a1fc99f156
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/pwrite.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_pwrite
+
+static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
+				 off_t offset) internal_function;
+
+
+ssize_t
+__pwrite (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, offset, 0);
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pwrite (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pwrite, pwrite)
+
+#define __pwrite(fd, buf, count, offset) \
+     static internal_function __emulate_pwrite (fd, buf, count, offset)
+#endif
+#include <sysdeps/posix/pwrite.c>
diff --git a/sysdeps/unix/sysv/linux/i386/pwrite64.c b/sysdeps/unix/sysv/linux/i386/pwrite64.c
new file mode 100644
index 0000000000..7a5d665de3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/pwrite64.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_pwrite
+
+static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
+				   off64_t offset) internal_function;
+
+
+ssize_t
+__pwrite64 (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
+			   (off_t) (offset & 0xffffffff),
+			   (off_t) (offset >> 32));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pwrite64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pwrite64, pwrite64)
+
+#define __pwrite64(fd, buf, count, offset) \
+     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
+#endif
+#include <sysdeps/posix/pwrite64.c>
diff --git a/sysdeps/unix/sysv/linux/i386/s_pread64.S b/sysdeps/unix/sysv/linux/i386/s_pread64.S
deleted file mode 100644
index 7817cf7980..0000000000
--- a/sysdeps/unix/sysv/linux/i386/s_pread64.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* pread64 syscall for Linux/ix86.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include <sysdep.h>
-#include <asm/errno.h>
-
-/* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
-   more information about the value -4095 used below.*/
-
-	.text
-ENTRY (__syscall_pread64)
-
-#ifndef __NR_pread
-	movl	$-ENOSYS,%eax
-# ifndef PIC
-	jmp	syscall_error
-# endif
-#else
-
-	PUSHARGS_5		/* Save register contents.  */
-
-	/* Load arguments.  This is unfortunately a little bit of a problem
-	   since the kernel expects the arguments in a different order.  */
-	movl	0x20(%esp,1),%esi
-	movl	0x1c(%esp,1),%edi
-	movl	0x18(%esp,1),%edx
-	movl	0x14(%esp,1),%ecx
-	movl	0x10(%esp,1),%ebx
-	/* Load syscall number into %eax.  */
-	movl	$SYS_ify(pread), %eax
-	int	$0x80			/* Do the system call.  */
-	POPARGS_5			/* Restore register contents.  */
-	cmpl	$-4095, %eax		/* Check %eax for error.  */
-	jae	SYSCALL_ERROR_LABEL	/* Jump to error handler if error.  */
-#endif
-L(pseudo_end):
-	ret			/* Return to caller.  */
-
-PSEUDO_END (__syscall_pread64)
diff --git a/sysdeps/unix/sysv/linux/i386/s_pwrite64.S b/sysdeps/unix/sysv/linux/i386/s_pwrite64.S
deleted file mode 100644
index 89449b6fb5..0000000000
--- a/sysdeps/unix/sysv/linux/i386/s_pwrite64.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* pwrite64 syscall for Linux/ix86.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include <sysdep.h>
-#include <asm/errno.h>
-
-/* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
-   more information about the value -4095 used below.*/
-
-	.text
-ENTRY (__syscall_pwrite64)
-
-#ifndef __NR_pwrite
-	movl	$-ENOSYS,%eax
-# ifndef PIC
-	jmp	syscall_error
-# endif
-#else
-
-	PUSHARGS_5		/* Save register contents.  */
-
-	/* Load arguments.  This is unfortunately a little bit of a problem
-	   since the kernel expects the arguments in a different order.  */
-	movl	0x20(%esp,1),%esi
-	movl	0x1c(%esp,1),%edi
-	movl	0x18(%esp,1),%edx
-	movl	0x14(%esp,1),%ecx
-	movl	0x10(%esp,1),%ebx
-	/* Load syscall number into %eax.  */
-	movl	$SYS_ify(pwrite), %eax
-	int	$0x80			/* Do the system call.  */
-	POPARGS_5			/* Restore register contents.  */
-	cmpl	$-4095, %eax		/* Check %eax for error.  */
-	jae	SYSCALL_ERROR_LABEL	/* Jump to error handler if error.  */
-#endif
-L(pseudo_end):
-	ret			/* Return to caller.  */
-
-PSEUDO_END (__syscall_pwrite64)
diff --git a/sysdeps/unix/sysv/linux/i386/setfsgid.c b/sysdeps/unix/sysv/linux/i386/setfsgid.c
index 4af26f554d..1614431ada 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsgid.c
@@ -17,9 +17,11 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
 #include <unistd.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 #include <linux/posix_types.h>
 
@@ -35,13 +37,6 @@ setfsgid (gid_t gid)
       return -1;
     }
 
-  return __syscall_setfsgid (gid);
-}
-#else
-int
-setfsgid (gid_t gid)
-{
-  __set_errno (ENOSYS);
-  return -1;
+  return INLINE_SYSCALL (setfsgid, 1, gid);
 }
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/setfsuid.c b/sysdeps/unix/sysv/linux/i386/setfsuid.c
index 5133dc0045..a2983a5e7a 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsuid.c
@@ -17,9 +17,11 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
 #include <unistd.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 #include <linux/posix_types.h>
 
@@ -35,13 +37,6 @@ setfsuid (uid_t uid)
       return -1;
     }
 
-  return __syscall_setfsuid (uid);
-}
-#else
-int
-setfsuid (uid_t uid)
-{
-  __set_errno (ENOSYS);
-  return -1;
+  return INLINE_SYSCALL (setfsuid, 1, uid);
 }
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/setgid.c b/sysdeps/unix/sysv/linux/i386/setgid.c
index 87fbd74e05..2ab8dfda34 100644
--- a/sysdeps/unix/sysv/linux/i386/setgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setgid.c
@@ -17,9 +17,11 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
 #include <unistd.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 #include <linux/posix_types.h>
 
@@ -35,6 +37,6 @@ __setgid (gid_t gid)
       return -1;
     }
 
-  return __syscall_setgid (gid);
+  return INLINE_SYSCALL (setgid, 1, gid);
 }
 weak_alias (__setgid, setgid)
diff --git a/sysdeps/unix/sysv/linux/i386/setgroups.c b/sysdeps/unix/sysv/linux/i386/setgroups.c
index 38e62a8217..ad2a6b5493 100644
--- a/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/setgroups.c
@@ -17,9 +17,12 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
 #include <grp.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 #include <linux/posix_types.h>
 
@@ -45,5 +48,6 @@ setgroups (n, groups)
 	  return -1;
 	}
     }
-  return __syscall_setgroups (n, kernel_groups);
+
+  return INLINE_SYSCALL (setgroups, 2, n, kernel_groups);
 }
diff --git a/sysdeps/unix/sysv/linux/i386/setregid.c b/sysdeps/unix/sysv/linux/i386/setregid.c
new file mode 100644
index 0000000000..98603bd2a2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/setregid.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <linux/posix_types.h>
+
+extern int __syscall_setregid (__kernel_gid_t, __kernel_gid_t);
+
+int
+__setregid (gid_t rgid, gid_t egid)
+{
+  if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid)
+      || (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return INLINE_SYSCALL (setregid, 2, rgid, egid);
+}
+weak_alias (__setregid, setregid)
diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c
index 20256e1ebd..ab2738582b 100644
--- a/sysdeps/unix/sysv/linux/i386/setresgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setresgid.c
@@ -22,6 +22,7 @@
 
 #include <linux/posix_types.h>
 
+#include <sysdep.h>
 #include <sys/syscall.h>
 #ifdef __NR_setresgid
 
@@ -31,14 +32,14 @@ extern int __syscall_setresgid (__kernel_gid_t rgid, __kernel_gid_t egid,
 int
 setresgid (gid_t rgid, gid_t egid, gid_t sgid)
 {
-  if ((rgid != (gid_t) ((__kernel_gid_t) rgid))
-      || (egid != (gid_t) ((__kernel_gid_t) egid))
-      || (sgid != (gid_t) ((__kernel_gid_t) sgid)))
+  if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid)
+      || (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid)
+      || (sgid != (gid_t) -1 && sgid != (gid_t) (__kernel_gid_t) sgid))
     {
       __set_errno (EINVAL);
       return -1;
     }
 
-  return __syscall_setresgid (rgid, egid, sgid);
+  return INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid);
 }
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c
index 5100681d2f..953b8294d6 100644
--- a/sysdeps/unix/sysv/linux/i386/setresuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setresuid.c
@@ -22,6 +22,7 @@
 
 #include <linux/posix_types.h>
 
+#include <sysdep.h>
 #include <sys/syscall.h>
 #ifdef __NR_setresuid
 
@@ -31,15 +32,15 @@ extern int __syscall_setresuid (__kernel_uid_t rgid, __kernel_uid_t egid,
 int
 __setresuid (uid_t ruid, uid_t euid, uid_t suid)
 {
-  if ((ruid != (uid_t) ((__kernel_uid_t) ruid))
-      || (euid != (uid_t) ((__kernel_uid_t) euid))
-      || (suid != (uid_t) ((__kernel_uid_t) suid)))
+  if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
+      || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid)
+      || (suid != (uid_t) -1 && suid != (uid_t) (__kernel_uid_t) suid))
     {
       __set_errno (EINVAL);
       return -1;
     }
 
-  return __syscall_setresuid (ruid, euid, suid);
+  return INLINE_SYSCALL (setresuid, 3, ruid, euid, suid);
 }
 weak_alias (__setresuid, setresuid)
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
new file mode 100644
index 0000000000..f38f136920
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <linux/posix_types.h>
+
+extern int __syscall_setreuid (__kernel_uid_t, __kernel_uid_t);
+
+int
+__setreuid (uid_t ruid, uid_t euid)
+{
+  if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
+      || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return INLINE_SYSCALL (setreuid, 2, ruid, euid);
+}
+weak_alias (__setreuid, setreuid)
diff --git a/sysdeps/unix/sysv/linux/i386/setuid.c b/sysdeps/unix/sysv/linux/i386/setuid.c
index 3379114384..5e5346ca42 100644
--- a/sysdeps/unix/sysv/linux/i386/setuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setuid.c
@@ -17,9 +17,11 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
 #include <unistd.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 #include <linux/posix_types.h>
 
@@ -35,6 +37,6 @@ __setuid (uid_t uid)
       return -1;
     }
 
-  return __syscall_setuid (uid);
+  return INLINE_SYSCALL (setuid, 1, uid);
 }
 weak_alias (__setuid, setuid)
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index e02c5cffce..b8421e9bb2 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -1,14 +1,5 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 modify_ldt	EXTRA	modify_ldt	3	__modify_ldt	modify_ldt
-s_chown		chown	chown		3	__syscall_chown
-s_getgroups	getgroups getgroups	2	__syscall_getgroups
 s_llseek	llseek	_llseek		5	__sys_llseek
-s_setfsgid	setfsgid setfsgid	1	__syscall_setfsgid
-s_setfsuid	setfsuid setfsuid	1	__syscall_setfsuid
-s_setgid	setgid	setgid		1	__syscall_setgid
-s_setgroups	setgroups setgroups	2	__syscall_setgroups
-s_setresgid	setresgid setresgid	3	__syscall_setresgid
-s_setresuid	setresuid setresuid	3	__syscall_setresuid
-s_setuid	setuid	setuid		1	__syscall_setuid
 vm86		-	vm86		1	__vm86		vm86
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index 7fbe14e138..50aa4f9969 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -1,5 +1,5 @@
 /* lxstat using old-style Unix lstat system call.
-   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_lstat (const char *, struct kernel_stat *);
@@ -38,9 +41,11 @@ __lxstat (int vers, const char *name, struct stat *buf)
   int result;
 
   if (vers == _STAT_VER_KERNEL)
-    return __syscall_lstat (name, (struct kernel_stat *) buf);
+    {
+      return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
+    }
 
-  result =  __syscall_lstat (name, &kbuf);
+  result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
   if (result == 0)
     result = xstat_conv (vers, &kbuf, buf);
 
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 8813fadd4c..60280804db 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -1,5 +1,5 @@
 /* lxstat64 using old-style Unix lstat system call.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_lstat (const char *, struct kernel_stat *);
@@ -33,7 +36,7 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
   struct kernel_stat kbuf;
   int result;
 
-  result =  __syscall_lstat (name, &kbuf);
+  result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
   if (result == 0)
     result = xstat64_conv (vers, &kbuf, buf);
 
diff --git a/sysdeps/unix/sysv/linux/m68k/setregid.c b/sysdeps/unix/sysv/linux/m68k/setregid.c
new file mode 100644
index 0000000000..99c57ad20f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/setregid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setreuid.c b/sysdeps/unix/sysv/linux/m68k/setreuid.c
new file mode 100644
index 0000000000..8ad61226e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/setreuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list
index 93dec8c118..d10a6e8626 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -8,6 +8,38 @@ s_setfsgid	setfsgid setfsgid	1	__syscall_setfsgid
 s_setfsuid	setfsuid setfsuid	1	__syscall_setfsuid
 s_setgid	setgid	setgid		1	__syscall_setgid
 s_setgroups	setgroups setgroups	2	__syscall_setgroups
+s_setregid	setregid setregid	2	__syscall_setregid
 s_setresgid	setresgid setresgid	3	__syscall_setresgid
 s_setresuid	setresuid setresuid	3	__syscall_setresuid
+s_setreuid	setreuid setreuid	2	__syscall_setreuid
 s_setuid	setuid	setuid		1	__syscall_setuid
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index b9392001e4..7f3630c586 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -41,9 +41,33 @@ getresgid	-	getresgid	3	getresgid
 # There are defined locally because the caller is also defined in this dir.
 #
 s_llseek	llseek	_llseek		5	__sys_llseek
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
 s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
 s_ustat		ustat	ustat		2	__syscall_ustat
-sys_mknod	xmknod	mknod		3	__syscall_mknod
 sys_fstat	fxstat	fstat		2	__syscall_fstat
 sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
 sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/poll.c b/sysdeps/unix/sysv/linux/poll.c
index 8119a974c1..880eeb9aa8 100644
--- a/sysdeps/unix/sysv/linux/poll.c
+++ b/sysdeps/unix/sysv/linux/poll.c
@@ -20,12 +20,12 @@
 #include <errno.h>
 #include <sys/poll.h>
 
+#include <sysdep.h>
 #include <sys/syscall.h>
 #ifdef __NR_poll
 
 extern int __syscall_poll __P ((struct pollfd *fds, unsigned int nfds,
 				int timeout));
-weak_extern (__syscall_poll)
 
 static int __emulate_poll __P ((struct pollfd *fds, unsigned long int nfds,
 				int timeout)) internal_function;
@@ -38,21 +38,16 @@ __poll (fds, nfds, timeout)
      int timeout;
 {
   static int must_emulate = 0;
-  int (*syscall) __P ((struct pollfd *, unsigned int, int)) = __syscall_poll;
 
   if (!must_emulate)
     {
-      if (syscall)
-	{
-	  int errno_saved = errno;
-	  int retval = __syscall_poll (fds, nfds, timeout);
+      int errno_saved = errno;
+      int retval = INLINE_SYSCALL (poll, 3, fds, nfds, timeout);
 
-	  if (retval >= 0 || errno != ENOSYS)
-	    return retval;
-
-	  __set_errno (errno_saved);
-	}
+      if (retval >= 0 || errno != ENOSYS)
+	return retval;
 
+      __set_errno (errno_saved);
       must_emulate = 1;
     }
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/syscalls.list
index a9f0bde314..92939bd3ba 100644
--- a/sysdeps/unix/sysv/linux/powerpc/syscalls.list
+++ b/sysdeps/unix/sysv/linux/powerpc/syscalls.list
@@ -5,3 +5,33 @@ s_llseek	llseek	_llseek		5	__sys_llseek
 s_chown		chown	chown		3	__syscall_chown
 s_pread64	pread64	pread		4	__syscall_pread64 
 s_pwrite64	pwrite64 pwrite		4	__syscall_pwrite64 
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index 4d7a7c5ad7..9554fb3878 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -19,6 +19,8 @@
 
 #include <errno.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 #ifdef __NR_pread
@@ -40,7 +42,7 @@ __pread (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-  result = __syscall_pread64 (fd, buf, count, 0, offset);
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count, 0, offset);
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pread (fd, buf, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index bd600f17d4..a5b7d97fcf 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -19,6 +19,8 @@
 
 #include <errno.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 #ifdef __NR_pread
@@ -40,8 +42,8 @@ __pread64 (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-  result = __syscall_pread64 (fd, buf, count, (off_t) (offset >> 32),
-			      (off_t) (offset & 0xffffffff));
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count, (off_t) (offset >> 32),
+			   (off_t) (offset & 0xffffffff));
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pread64 (fd, buf, count, offset);
diff --git a/sysdeps/unix/sysv/linux/ptrace.c b/sysdeps/unix/sysv/linux/ptrace.c
index 1c60931926..109191ea47 100644
--- a/sysdeps/unix/sysv/linux/ptrace.c
+++ b/sysdeps/unix/sysv/linux/ptrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,9 @@
 #include <sys/ptrace.h>
 #include <stdarg.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern long int __syscall_ptrace (int, pid_t, void *, void *);
 
 long int
@@ -40,17 +43,12 @@ ptrace (enum __ptrace_request request, ...)
   if (request > 0 && request < 4)
     data = &ret;
 
-  res = __syscall_ptrace (request, pid, addr, data);
-
-  if (res >= 0)
+  res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data);
+  if (res >= 0 && request > 0 && request < 4)
     {
-      if (request > 0 && request < 4)
-	{
-	  __set_errno (0);
-	  return ret;
-	}
-      return res;
+      __set_errno (0);
+      return ret;
     }
 
-  return -1;
+  return res;
 }
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index 72b3cfba66..74be599b09 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -19,6 +19,8 @@
 
 #include <errno.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 #ifdef __NR_pwrite
@@ -40,7 +42,7 @@ __pwrite (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-  result = __syscall_pwrite64 (fd, buf, count, 0, offset);
+  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, 0, offset);
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pwrite (fd, buf, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index 70902b28b7..b6ebba154b 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -19,6 +19,8 @@
 
 #include <errno.h>
 #include <unistd.h>
+
+#include <sysdep.h>
 #include <sys/syscall.h>
 
 #ifdef __NR_pwrite
@@ -40,8 +42,8 @@ __pwrite64 (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-  result = __syscall_pwrite64 (fd, buf, count, (off_t) (offset >> 32),
-			       (off_t) (offset & 0xffffffff));
+  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, (off_t) (offset >> 32),
+			   (off_t) (offset & 0xffffffff));
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
     result = __emulate_pwrite64 (fd, buf, count, offset);
diff --git a/sysdeps/unix/sysv/linux/readv.c b/sysdeps/unix/sysv/linux/readv.c
index 10cd519609..9f2b437a53 100644
--- a/sysdeps/unix/sysv/linux/readv.c
+++ b/sysdeps/unix/sysv/linux/readv.c
@@ -1,5 +1,5 @@
 /* readv supports all Linux kernels >= 2.0.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/param.h>
 #include <sys/uio.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern ssize_t __syscall_readv __P ((int, __const struct iovec *, int));
 static ssize_t __atomic_readv_replacement __P ((int, __const struct iovec *,
 						int)) internal_function;
@@ -44,7 +47,7 @@ __readv (fd, vector, count)
   int errno_saved = errno;
   ssize_t bytes_read;
 
-  bytes_read = __syscall_readv (fd, vector, count);
+  bytes_read = INLINE_SYSCALL (readv, 3, fd, vector, count);
 
   if (bytes_read >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
     return bytes_read;
diff --git a/sysdeps/unix/sysv/linux/reboot.c b/sysdeps/unix/sysv/linux/reboot.c
index 4b64d9d813..1a01ec2f61 100644
--- a/sysdeps/unix/sysv/linux/reboot.c
+++ b/sysdeps/unix/sysv/linux/reboot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,13 +16,17 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <sys/reboot.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_reboot (int magic, int magic_too, int flag);
 
 /* Call kernel with additional two arguments the syscall requires.  */
 int
 reboot (int howto)
 {
-  return __syscall_reboot (0xfee1dead, 672274793, howto);
+  return INLINE_SYSCALL (reboot, 3, 0xfee1dead, 672274793, howto);
 }
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index 773bfa067f..72cead81d2 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -20,6 +20,9 @@
 #include <signal.h>
 #include <string.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 /* The difference here is that the sigaction structure used in the
    kernel is not the same as we use in the libc.  Therefore we must
    translate it here.  */
@@ -64,8 +67,8 @@ __sigaction (sig, act, oact)
 
       /* XXX The size argument hopefully will have to be changed to the
 	 real size of the user-level sigset_t.  */
-      result = __syscall_rt_sigaction (sig, act ? &kact : 0,
-				       oact ? &koact : 0, _NSIG / 8);
+      result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : 0,
+			       oact ? &koact : 0, _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
 	{
@@ -94,8 +97,8 @@ __sigaction (sig, act, oact)
       k_sigact.sa_restorer = act->sa_restorer;
 #endif
     }
-  result = __syscall_sigaction (sig, act ? &k_sigact : 0,
-			       oact ? &k_osigact : 0);
+  result = INLINE_SYSCALL (sigaction, 3, sig, act ? &k_sigact : 0,
+			   oact ? &k_osigact : 0);
   if (oact && result >= 0)
     {
       oact->sa_handler = k_osigact.k_sa_handler;
diff --git a/sysdeps/unix/sysv/linux/siglist.h b/sysdeps/unix/sysv/linux/siglist.h
index 63c716cfcb..4c47e8a302 100644
--- a/sysdeps/unix/sysv/linux/siglist.h
+++ b/sysdeps/unix/sysv/linux/siglist.h
@@ -22,7 +22,7 @@
   init_sig (SIGHUP, "HUP", N_("Hangup"))
   init_sig (SIGINT, "INT", N_("Interrupt"))
   init_sig (SIGQUIT, "QUIT", N_("Quit"))
-  init_sig (SIGILL, "ILL", N_("Illegal Instruction"))
+  init_sig (SIGILL, "ILL", N_("Illegal instruction"))
   init_sig (SIGTRAP, "TRAP", N_("Trace/breakpoint trap"))
   init_sig (SIGABRT, "ABRT", N_("Aborted"))
   init_sig (SIGFPE, "FPE", N_("Floating point exception"))
diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
index 1776fdd65f..b3706263a6 100644
--- a/sysdeps/unix/sysv/linux/sigpending.c
+++ b/sysdeps/unix/sysv/linux/sigpending.c
@@ -20,6 +20,9 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_sigpending (sigset_t *);
 extern int __syscall_rt_sigpending (sigset_t *, size_t);
 
@@ -41,7 +44,7 @@ sigpending (set)
       /* XXX The size argument hopefully will have to be changed to the
 	 real size of the user-level sigset_t.  */
       int saved_errno = errno;
-      int result = __syscall_rt_sigpending (set, _NSIG / 8);
+      int result = INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
 	return result;
@@ -50,5 +53,5 @@ sigpending (set)
       __libc_missing_rt_sigs = 1;
     }
 
-  return __syscall_sigpending (set);
+  return INLINE_SYSCALL (sigpending, 1, set);
 }
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index 064179e2b8..62c5f772f6 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -20,6 +20,9 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_sigprocmask (int, const sigset_t *, sigset_t *);
 extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *,
 				     size_t);
@@ -42,7 +45,8 @@ __sigprocmask (how, set, oset)
       /* XXX The size argument hopefully will have to be changed to the
 	 real size of the user-level sigset_t.  */
       int saved_errno = errno;
-      int result = __syscall_rt_sigprocmask (how, set, oset, _NSIG / 8);
+      int result = INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset,
+				   _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
 	return result;
@@ -51,6 +55,6 @@ __sigprocmask (how, set, oset)
       __libc_missing_rt_sigs = 1;
     }
 
-  return __syscall_sigprocmask (how, set, oset);
+  return INLINE_SYSCALL (sigprocmask, 3, how, set, oset);
 }
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sigqueue.c b/sysdeps/unix/sysv/linux/sigqueue.c
index 5719e2497b..fa31119cfd 100644
--- a/sysdeps/unix/sysv/linux/sigqueue.c
+++ b/sysdeps/unix/sysv/linux/sigqueue.c
@@ -16,9 +16,13 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <signal.h>
 #include <unistd.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *);
 
 
@@ -39,6 +43,6 @@ __sigqueue (pid, sig, val)
   info.si_uid = __getuid ();
   info.si_value = val;
 
-  return __syscall_rt_sigqueueinfo (pid, sig, &info);
+  return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info);
 }
 weak_alias (__sigqueue, sigqueue)
diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c
index a5d2eb0ad7..b9aeffe9ff 100644
--- a/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -20,6 +20,9 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_sigsuspend (int, unsigned long int, unsigned long int);
 extern int __syscall_rt_sigsuspend (const sigset_t *, size_t);
 
@@ -41,7 +44,7 @@ __sigsuspend (set)
       /* XXX The size argument hopefully will have to be changed to the
 	 real size of the user-level sigset_t.  */
       int saved_errno = errno;
-      int result = __syscall_rt_sigsuspend (set, _NSIG / 8);
+      int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
 	return result;
@@ -50,6 +53,6 @@ __sigsuspend (set)
       __libc_missing_rt_sigs = 1;
     }
 
-  return __syscall_sigsuspend (0, 0, set->__val[0]);
+  return INLINE_SYSCALL (sigsuspend, 3, 0, 0, set->__val[0]);
 }
 weak_alias (__sigsuspend, sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/sigtimedwait.c b/sysdeps/unix/sysv/linux/sigtimedwait.c
index 90854c64d9..09c04cf81b 100644
--- a/sysdeps/unix/sysv/linux/sigtimedwait.c
+++ b/sysdeps/unix/sysv/linux/sigtimedwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <signal.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *,
 				      const struct timespec *, size_t);
 
@@ -31,6 +35,6 @@ __sigtimedwait (set, info, timeout)
 {
   /* XXX The size argument hopefully will have to be changed to the
      real size of the user-level sigset_t.  */
-  return __syscall_rt_sigtimedwait (set, info, timeout, _NSIG / 8);
+  return INLINE_SYSCALL (rt_sigtimedwait, 4, set, info, timeout, _NSIG / 8);
 }
 weak_alias (__sigtimedwait, sigtimedwait)
diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c
index da4624e53e..718d179fc1 100644
--- a/sysdeps/unix/sysv/linux/sigwaitinfo.c
+++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c
@@ -16,10 +16,14 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <signal.h>
 #define __need_NULL
 #include <stddef.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *,
 				      const struct timespec *, size_t);
 
@@ -32,6 +36,6 @@ __sigwaitinfo (set, info)
 {
   /* XXX The size argument hopefully will have to be changed to the
      real size of the user-level sigset_t.  */
-  return __syscall_rt_sigtimedwait (set, info, NULL, _NSIG / 8);
+  return INLINE_SYSCALL (rt_sigtimedwait, 4, set, info, NULL, _NSIG / 8);
 }
 weak_alias (__sigwaitinfo, sigwaitinfo)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c
new file mode 100644
index 0000000000..99c57ad20f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c
new file mode 100644
index 0000000000..8ad61226e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index fce5b5fcf9..f5413ce6b4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
@@ -5,6 +5,38 @@ s_getpagesize	getpagesize getpagesize	0	__syscall_getpagesize
 s_llseek	llseek	_llseek		5	__sys_llseek
 s_setgid	setgid	setgid		1	__syscall_setgid
 s_setgroups	setgroups setgroups	2	__syscall_setgroups
+s_setregid	setregid setregid	2	__syscall_setregid
 s_setresgid	setresgid setresgid	3	__syscall_setresgid
 s_setresuid	setresuid setresuid	3	__syscall_setresuid
+s_setreuid	setreuid setreuid	2	__syscall_setreuid
 s_setuid	setuid	setuid		1	__syscall_setuid
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index 1ec42fa42e..ed7bca030a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -33,3 +33,33 @@ socketpair	-	socketpair	4	__socketpair	socketpair
 
 getresuid	-	getresuid	3	getresuid
 getresgid	-	getresgid	3	getresuid
+
+# System calls with wrappers.
+rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
+rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
+rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
+rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
+rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
+rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
+s_getcwd	getcwd	getcwd		2	__syscall_getcwd
+s_getdents	getdents getdents	3	__syscall_getdents
+s_getpriority	getpriority getpriority	2	__syscall_getpriority
+s_getresgid	getresgid getresgid	3	__syscall_getresgid
+s_getresuid	getresuid getresuid	3	__syscall_getresuid
+s_poll		poll	poll		3	__syscall_poll
+s_pread64	pread64	pread		5	__syscall_pread64
+s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
+s_reboot	reboot	reboot		3	__syscall_reboot
+s_sigaction	sigaction sigaction	3	__syscall_sigaction
+s_sigpending	sigpending sigpending	1	__syscall_sigpending
+s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
+s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
+s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
+s_ustat		ustat	ustat		2	__syscall_ustat
+sys_fstat	fxstat	fstat		2	__syscall_fstat
+sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_mknod	xmknod	mknod		3	__syscall_mknod
+sys_readv	readv	readv		3	__syscall_readv
+sys_stat	xstat	stat		2	__syscall_stat
+sys_writev	writev	writev		3	__syscall_writev
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 8880035ed4..a2ea5b8d99 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -36,28 +36,6 @@ pipe		-	pipe		1	__pipe		pipe
 prctl		EXTRA	prctl		5	prctl
 query_module	EXTRA	query_module	5	query_module
 quotactl	EXTRA	quotactl	4	quotactl
-rt_sigaction	-	rt_sigaction	4	__syscall_rt_sigaction
-rt_sigpending	-	rt_sigpending	2	__syscall_rt_sigpending
-rt_sigprocmask	-	rt_sigprocmask	4	__syscall_rt_sigprocmask
-rt_sigqueueinfo	-	rt_sigqueueinfo	3	__syscall_rt_sigqueueinfo
-rt_sigsuspend	-	rt_sigsuspend	2	__syscall_rt_sigsuspend
-rt_sigtimedwait	-	rt_sigtimedwait	4	__syscall_rt_sigtimedwait
-s_getcwd	getcwd	getcwd		2	__syscall_getcwd
-s_getdents	getdents getdents	3	__getdents
-s_getpriority	getpriority getpriority	2	__syscall_getpriority
-s_getresgid	getresgid getresgid	3	__syscall_getresgid
-s_getresuid	getresuid getresuid	3	__syscall_getresuid
-s_poll		poll	poll		3	__syscall_poll
-s_pread64	pread64	pread		5	__syscall_pread64
-s_ptrace	ptrace	ptrace		4	__syscall_ptrace
-s_pwrite64	pwrite64 pwrite		5	__syscall_pwrite64
-s_reboot	reboot	reboot		3	__syscall_reboot
-s_sigaction	sigaction sigaction	3	__syscall_sigaction
-s_sigpending	sigpending sigpending	1	__syscall_sigpending
-s_sigprocmask	sigprocmask sigprocmask	3	__syscall_sigprocmask
-s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
-s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
-s_ustat		ustat	ustat		2	__syscall_ustat
 sched_getp	-	sched_getparam	2	__sched_getparam	sched_getparam
 sched_gets	-	sched_getscheduler	1	__sched_getscheduler	sched_getscheduler
 sched_primax	-	sched_get_priority_max	1	__sched_get_priority_max	sched_get_priority_max
@@ -74,12 +52,6 @@ setpgid		-	setpgid		2	__setpgid	setpgid
 setresuid	EXTRA	setresuid	3	__setresuid	setresuid
 setresgid	EXTRA	setresgid	3	setresgid
 sigaltstack	-	sigaltstack	2	__sigaltstack	sigaltstack
-sys_fstat	fxstat	fstat		2	__syscall_fstat
-sys_lstat	lxstat	lstat		2	__syscall_lstat
-sys_mknod	xmknod	mknod		3	__syscall_mknod
-sys_readv	readv	readv		3	__syscall_readv
-sys_stat	xstat	stat		2	__syscall_stat
-sys_writev	writev	writev		3	__syscall_writev
 sysinfo		EXTRA	sysinfo		1	sysinfo
 swapon		-	swapon		2	__swapon	swapon
 swapoff		-	swapoff		1	__swapoff	swapoff
diff --git a/sysdeps/unix/sysv/linux/sysctl.c b/sysdeps/unix/sysv/linux/sysctl.c
index 9c136a5c64..1ab3c79bed 100644
--- a/sysdeps/unix/sysv/linux/sysctl.c
+++ b/sysdeps/unix/sysv/linux/sysctl.c
@@ -1,5 +1,5 @@
-/* sysctl - Read or write system information.  Linux version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Read or write system information.  Linux version.
+   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,8 +17,11 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <sys/sysctl.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 extern int __syscall__sysctl (struct __sysctl_args *args);
 
@@ -36,5 +39,5 @@ sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
     newlen: newlen
   };
 
-  return __syscall__sysctl (&args);
+  return INLINE_SYSCALL (_sysctl, 1, &args);
 }
diff --git a/sysdeps/unix/sysv/linux/ustat.c b/sysdeps/unix/sysv/linux/ustat.c
index a8dfbb4191..fdf20324b2 100644
--- a/sysdeps/unix/sysv/linux/ustat.c
+++ b/sysdeps/unix/sysv/linux/ustat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -17,9 +17,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <sys/ustat.h>
 #include <sys/sysmacros.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
 
 extern int __syscall_ustat (unsigned short int dev, struct ustat *ubuf);
 
@@ -31,5 +34,5 @@ ustat (dev_t dev, struct ustat *ubuf)
   /* We must convert the value to dev_t type used by the kernel.  */
   k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
 
-  return __syscall_ustat (k_dev, ubuf);
+  return INLINE_SYSCALL (ustat, 2, k_dev, ubuf);
 }
diff --git a/sysdeps/unix/sysv/linux/writev.c b/sysdeps/unix/sysv/linux/writev.c
index 3b3c5b65fc..77ad9f599c 100644
--- a/sysdeps/unix/sysv/linux/writev.c
+++ b/sysdeps/unix/sysv/linux/writev.c
@@ -1,5 +1,5 @@
 /* writev supports all Linux kernels >= 2.0.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/param.h>
 #include <sys/uio.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern ssize_t __syscall_writev __P ((int, const struct iovec *, int));
 static ssize_t __atomic_writev_replacement __P ((int, const struct iovec *,
 						 int)) internal_function;
@@ -44,7 +47,7 @@ __writev (fd, vector, count)
   int errno_saved = errno;
   ssize_t bytes_written;
 
-  bytes_written = __syscall_writev (fd, vector, count);
+  bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count);
 
   if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
     return bytes_written;
diff --git a/sysdeps/unix/sysv/linux/xmknod.c b/sysdeps/unix/sysv/linux/xmknod.c
index cd73849021..d58da2828d 100644
--- a/sysdeps/unix/sysv/linux/xmknod.c
+++ b/sysdeps/unix/sysv/linux/xmknod.c
@@ -1,5 +1,5 @@
 /* xmknod call using old-style Unix mknod system call.
-   Copyright (C) 1991, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 extern int __syscall_mknod (const char *, unsigned short int,
 			    unsigned short int);
 
@@ -42,7 +45,7 @@ __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
   /* We must convert the value to dev_t type used by the kernel.  */
   k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff);
 
-  return __syscall_mknod (path, mode, k_dev);
+  return INLINE_SYSCALL (mknod, 3, path, mode, k_dev);
 }
 
 weak_alias (__xmknod, _xmknod)
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index 85328574cf..79759fec63 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -1,5 +1,5 @@
 /* xstat using old-style Unix stat system call.
-   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_stat (const char *, struct kernel_stat *);
@@ -38,9 +41,11 @@ __xstat (int vers, const char *name, struct stat *buf)
   int result;
 
   if (vers == _STAT_VER_KERNEL)
-    return __syscall_stat (name, (struct kernel_stat *) buf);
+    {
+      return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf);
+    }
 
-  result =  __syscall_stat (name, &kbuf);
+  result = INLINE_SYSCALL (stat, 2, name, &kbuf);
   if (result == 0)
     result = xstat_conv (vers, &kbuf, buf);
 
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index 02f70c5c51..33f130bb68 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -1,5 +1,5 @@
 /* xstat64 using old-style Unix stat system call.
-   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,9 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#include <sysdep.h>
+#include <sys/syscall.h>
+
 #include <xstatconv.c>
 
 extern int __syscall_stat (const char *, struct kernel_stat *);
@@ -33,7 +36,7 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
   struct kernel_stat kbuf;
   int result;
 
-  result =  __syscall_stat (name, &kbuf);
+  result = INLINE_SYSCALL (stat, 2, name, &kbuf);
   if (result == 0)
     result = xstat64_conv (vers, &kbuf, buf);