From: "Randy.Dunlap" <rddunlap@osdl.org>

Add generic and -erparch header files which contain prototypes for the
kernel system calls.  Remove open-coded decls all over the place.

DESC
syscalls.h update1
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

I'm going thru all syscalls, one function name at a time, and removing
unneeded prototypes and adding #include syscalls.h.

DESC
more syscalls.h stuff
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

Cleanups for more syscall prototypes.

DESC
syscalls.h fixes
EDESC
From: Arnd Bergmann <arnd@arndb.de>,
      Randy Dunlap <rddunlap@osdl.org>

I've built kernels for s390 and x86_64.  This is the patch I used to fix up
the warnings.

DESC
syscalls.h (updates # 6)
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

- sys_brk() is used in a few places but does not yet live in syscalls.h
  or unistd.h.

- sys_mmap():  need to check on these

- sys_execve():  need to check/rationalize/sanitize

- still some sys_wait4() cleanups to be done

DESC
syscalls update ver. 7
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

add missing syscalls: sys_pipe, sys_ptrace, msg/sem syscalls (from msg.h /
sem.h);

DESC
syscalls update #8
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

This is the next syscalls update.

Built on ia32, ia64, and x86_64(X-build).

Andi, would you look at the changes to include/asm-x86_64/unistd.h please? 
I'm not terribly happy with them, but it took several iterations to get the
compiler happy with it.

What's left:
- include/linux/fs.h:  sys_open, sys_close
- fixing all uses of __KERNEL_SYSCALLS__

DESC
syscalls.h update #9 (open/close)
EDESC
From: "Randy.Dunlap" <rddunlap@osdl.org>

Here's the next installment in moving syscall prototypes to
linux/syscalls.h and removing the ad hoc instances of them.

Built on ia32, ia64, and x86_64.

(patch archive is at:
  http://developer.osdl.org/rddunlap/syscalls/)

This is my last planned patch, but I'll be looking for syscalls that I've
missed.  I expect that there will be a few.

DESC
syscalls.h #10
EDESC
From: "Randy.Dunlap" <randy.dunlap@verizon.net>

description:	add arch-specific:
		  sys_ioperm, sys_iopl,
		  sys_request_irq, sys_free_irq,
		  sys_pread_wrapper, sys_pwrite_wrapper;
		add generic:
		  sys_statfs family, sys_msync,
		  sys_fadvise family, sys_mlockall/unlockall,
		  sys_madvise, sys_mincore,
		remove the only compat_sys_* from syscalls.h;

DESC
syscalls.h: x86_64 warning fix
EDESC

In file included from include/linux/unistd.h:9,
                 from fs/nfsd/export.c:17:
include/asm/unistd.h:722: warning: `struct pt_regs' declared inside parameter list
include/asm/unistd.h:722: warning: its scope is only this definition or declaration, which is probably not what you want
include/asm/unistd.h:722: warning: parameter has incomplete type


---

 25-x86_64-akpm/arch/alpha/kernel/alpha_ksyms.c          |    1 
 25-x86_64-akpm/arch/alpha/kernel/osf_sys.c              |    5 
 25-x86_64-akpm/arch/arm/kernel/armksyms.c               |    9 
 25-x86_64-akpm/arch/arm/kernel/sys_arm.c                |    2 
 25-x86_64-akpm/arch/arm26/kernel/armksyms.c             |    9 
 25-x86_64-akpm/arch/arm26/kernel/sys_arm.c              |    2 
 25-x86_64-akpm/arch/cris/kernel/sys_cris.c              |    1 
 25-x86_64-akpm/arch/h8300/kernel/signal.c               |    3 
 25-x86_64-akpm/arch/h8300/kernel/sys_h8300.c            |    5 
 25-x86_64-akpm/arch/i386/kernel/sys_i386.c              |    3 
 25-x86_64-akpm/arch/ia64/ia32/ia32_ioctl.c              |    3 
 25-x86_64-akpm/arch/ia64/ia32/ia32_signal.c             |    7 
 25-x86_64-akpm/arch/ia64/ia32/sys_ia32.c                |   51 -
 25-x86_64-akpm/arch/ia64/kernel/sys_ia64.c              |    2 
 25-x86_64-akpm/arch/m68k/amiga/amiints.c                |    1 
 25-x86_64-akpm/arch/m68k/bvme6000/bvmeints.c            |    1 
 25-x86_64-akpm/arch/m68k/hp300/time.c                   |    1 
 25-x86_64-akpm/arch/m68k/kernel/signal.c                |    1 
 25-x86_64-akpm/arch/m68k/kernel/sys_m68k.c              |    5 
 25-x86_64-akpm/arch/m68k/mac/iop.c                      |    1 
 25-x86_64-akpm/arch/m68k/mac/macints.c                  |    2 
 25-x86_64-akpm/arch/m68k/mac/oss.c                      |    1 
 25-x86_64-akpm/arch/m68k/mac/psc.c                      |    1 
 25-x86_64-akpm/arch/m68k/mac/via.c                      |    2 
 25-x86_64-akpm/arch/m68k/q40/q40ints.c                  |    1 
 25-x86_64-akpm/arch/m68k/sun3/sun3ints.c                |    1 
 25-x86_64-akpm/arch/m68knommu/kernel/signal.c           |    3 
 25-x86_64-akpm/arch/m68knommu/kernel/sys_m68k.c         |    5 
 25-x86_64-akpm/arch/mips/kernel/ioctl32.c               |    3 
 25-x86_64-akpm/arch/mips/kernel/irixioctl.c             |    4 
 25-x86_64-akpm/arch/mips/kernel/linux32.c               |   23 
 25-x86_64-akpm/arch/mips/kernel/signal32.c              |    8 
 25-x86_64-akpm/arch/mips/kernel/syscall.c               |    1 
 25-x86_64-akpm/arch/mips/kernel/sysirix.c               |   28 
 25-x86_64-akpm/arch/parisc/hpux/ioctl.c                 |    3 
 25-x86_64-akpm/arch/parisc/hpux/sys_hpux.c              |    8 
 25-x86_64-akpm/arch/parisc/kernel/ioctl32.c             |    2 
 25-x86_64-akpm/arch/parisc/kernel/parisc_ksyms.c        |    5 
 25-x86_64-akpm/arch/parisc/kernel/signal32.c            |    5 
 25-x86_64-akpm/arch/parisc/kernel/sys_parisc.c          |   16 
 25-x86_64-akpm/arch/parisc/kernel/sys_parisc32.c        |    8 
 25-x86_64-akpm/arch/ppc/kernel/syscalls.c               |    3 
 25-x86_64-akpm/arch/ppc64/kernel/ioctl32.c              |    1 
 25-x86_64-akpm/arch/ppc64/kernel/ppc_ksyms.c            |    2 
 25-x86_64-akpm/arch/ppc64/kernel/signal32.c             |    1 
 25-x86_64-akpm/arch/ppc64/kernel/sys_ppc32.c            |  104 ---
 25-x86_64-akpm/arch/ppc64/kernel/syscalls.c             |    1 
 25-x86_64-akpm/arch/s390/kernel/compat_linux.c          |  102 ---
 25-x86_64-akpm/arch/s390/kernel/compat_linux.h          |    1 
 25-x86_64-akpm/arch/s390/kernel/compat_wrapper.S        |    6 
 25-x86_64-akpm/arch/s390/kernel/s390_ksyms.c            |    1 
 25-x86_64-akpm/arch/s390/kernel/sys_s390.c              |   13 
 25-x86_64-akpm/arch/sh/kernel/sys_sh.c                  |    5 
 25-x86_64-akpm/arch/sparc/kernel/setup.c                |    2 
 25-x86_64-akpm/arch/sparc/kernel/sunos_ioctl.c          |    2 
 25-x86_64-akpm/arch/sparc/kernel/sys_sparc.c            |    3 
 25-x86_64-akpm/arch/sparc/kernel/sys_sunos.c            |   22 
 25-x86_64-akpm/arch/sparc64/kernel/ioctl32.c            |    1 
 25-x86_64-akpm/arch/sparc64/kernel/setup.c              |    4 
 25-x86_64-akpm/arch/sparc64/kernel/sparc64_ksyms.c      |   11 
 25-x86_64-akpm/arch/sparc64/kernel/sunos_ioctl32.c      |    3 
 25-x86_64-akpm/arch/sparc64/kernel/sys_sparc.c          |    7 
 25-x86_64-akpm/arch/sparc64/kernel/sys_sparc32.c        |   67 --
 25-x86_64-akpm/arch/sparc64/kernel/sys_sunos32.c        |   16 
 25-x86_64-akpm/arch/sparc64/solaris/ioctl.c             |    3 
 25-x86_64-akpm/arch/sparc64/solaris/socksys.c           |    4 
 25-x86_64-akpm/arch/sparc64/solaris/timod.c             |    2 
 25-x86_64-akpm/arch/um/include/kern_util.h              |    1 
 25-x86_64-akpm/arch/um/kernel/sys_call_table.c          |    3 
 25-x86_64-akpm/arch/um/kernel/syscall_kern.c            |    1 
 25-x86_64-akpm/arch/v850/kernel/syscalls.c              |    1 
 25-x86_64-akpm/arch/x86_64/ia32/ia32_ioctl.c            |    3 
 25-x86_64-akpm/arch/x86_64/ia32/ipc32.c                 |    1 
 25-x86_64-akpm/arch/x86_64/ia32/ptrace32.c              |    4 
 25-x86_64-akpm/arch/x86_64/ia32/sys_ia32.c              |   66 --
 25-x86_64-akpm/arch/x86_64/kernel/sys_x86_64.c          |    1 
 25-x86_64-akpm/arch/x86_64/kernel/x8664_ksyms.c         |    3 
 25-x86_64-akpm/drivers/char/vt_ioctl.c                  |    2 
 25-x86_64-akpm/drivers/macintosh/via-pmu.c              |    3 
 25-x86_64-akpm/drivers/media/dvb/frontends/alps_tdlb7.c |    1 
 25-x86_64-akpm/drivers/media/dvb/frontends/sp887x.c     |    1 
 25-x86_64-akpm/drivers/media/dvb/frontends/tda1004x.c   |    1 
 25-x86_64-akpm/fs/binfmt_elf.c                          |    1 
 25-x86_64-akpm/fs/binfmt_misc.c                         |    1 
 25-x86_64-akpm/fs/compat.c                              |   14 
 25-x86_64-akpm/fs/compat_ioctl.c                        |    1 
 25-x86_64-akpm/fs/eventpoll.c                           |    1 
 25-x86_64-akpm/fs/exec.c                                |    1 
 25-x86_64-akpm/fs/nfsd/export.c                         |    1 
 25-x86_64-akpm/fs/nfsd/nfsctl.c                         |    1 
 25-x86_64-akpm/include/asm-alpha/unistd.h               |   15 
 25-x86_64-akpm/include/asm-arm/unistd.h                 |   21 
 25-x86_64-akpm/include/asm-arm26/unistd.h               |   26 
 25-x86_64-akpm/include/asm-cris/unistd.h                |   17 
 25-x86_64-akpm/include/asm-h8300/unistd.h               |    8 
 25-x86_64-akpm/include/asm-i386/unistd.h                |   14 
 25-x86_64-akpm/include/asm-ia64/unistd.h                |   33 -
 25-x86_64-akpm/include/asm-m68k/irq.h                   |    5 
 25-x86_64-akpm/include/asm-m68k/unistd.h                |   16 
 25-x86_64-akpm/include/asm-m68knommu/irq.h              |    5 
 25-x86_64-akpm/include/asm-m68knommu/unistd.h           |   16 
 25-x86_64-akpm/include/asm-mips/unistd.h                |   15 
 25-x86_64-akpm/include/asm-parisc/unistd.h              |   27 
 25-x86_64-akpm/include/asm-ppc/unistd.h                 |   21 
 25-x86_64-akpm/include/asm-ppc64/signal.h               |    9 
 25-x86_64-akpm/include/asm-ppc64/unistd.h               |   23 
 25-x86_64-akpm/include/asm-s390/unistd.h                |   20 
 25-x86_64-akpm/include/asm-sh/unistd.h                  |   29 
 25-x86_64-akpm/include/asm-sparc/unistd.h               |   10 
 25-x86_64-akpm/include/asm-sparc64/unistd.h             |    6 
 25-x86_64-akpm/include/asm-um/unistd.h                  |   26 
 25-x86_64-akpm/include/asm-v850/unistd.h                |   11 
 25-x86_64-akpm/include/asm-x86_64/compat.h              |    1 
 25-x86_64-akpm/include/asm-x86_64/proto.h               |    1 
 25-x86_64-akpm/include/asm-x86_64/unistd.h              |   46 +
 25-x86_64-akpm/include/linux/eventpoll.h                |    7 
 25-x86_64-akpm/include/linux/fs.h                       |    3 
 25-x86_64-akpm/include/linux/futex.h                    |    4 
 25-x86_64-akpm/include/linux/ioctl32.h                  |    2 
 25-x86_64-akpm/include/linux/mm.h                       |    2 
 25-x86_64-akpm/include/linux/msg.h                      |    5 
 25-x86_64-akpm/include/linux/nfsd/syscall.h             |    1 
 25-x86_64-akpm/include/linux/sched.h                    |    4 
 25-x86_64-akpm/include/linux/sem.h                      |    6 
 25-x86_64-akpm/include/linux/shm.h                      |    5 
 25-x86_64-akpm/include/linux/socket.h                   |    4 
 25-x86_64-akpm/include/linux/syscalls.h                 |  480 ++++++++++++++++
 25-x86_64-akpm/include/linux/sysctl.h                   |    1 
 25-x86_64-akpm/init/do_mounts.h                         |   15 
 25-x86_64-akpm/init/do_mounts_devfs.c                   |    9 
 25-x86_64-akpm/init/initramfs.c                         |   12 
 25-x86_64-akpm/init/main.c                              |    2 
 25-x86_64-akpm/ipc/sem.c                                |   10 
 25-x86_64-akpm/kernel/compat.c                          |   39 -
 25-x86_64-akpm/kernel/fork.c                            |    1 
 25-x86_64-akpm/kernel/kmod.c                            |    1 
 25-x86_64-akpm/kernel/module.c                          |    1 
 25-x86_64-akpm/kernel/panic.c                           |    3 
 25-x86_64-akpm/kernel/power/disk.c                      |    3 
 25-x86_64-akpm/kernel/power/swsusp.c                    |    3 
 25-x86_64-akpm/kernel/sysctl.c                          |    2 
 25-x86_64-akpm/kernel/uid16.c                           |   13 
 25-x86_64-akpm/mm/mmap.c                                |    1 
 25-x86_64-akpm/net/compat.c                             |   23 
 25-x86_64-akpm/net/socket.c                             |    1 
 25-x86_64-akpm/security/selinux/hooks.c                 |    1 
 arch/ppc64/kernel/rtasd.c                               |    0 
 147 files changed, 946 insertions(+), 882 deletions(-)

diff -puN arch/alpha/kernel/osf_sys.c~add-syscalls_h arch/alpha/kernel/osf_sys.c
--- 25-x86_64/arch/alpha/kernel/osf_sys.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/alpha/kernel/osf_sys.c	Sat Feb 21 21:40:49 2004
@@ -17,6 +17,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/stddef.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
@@ -46,7 +47,6 @@
 #include <asm/processor.h>
 
 extern int do_pipe(int *);
-extern asmlinkage unsigned long sys_brk(unsigned long);
 
 /*
  * Brk needs to return an error.  Still support Linux's brk(0) query idiom,
@@ -821,7 +821,6 @@ osf_setsysinfo(unsigned long op, void *b
    affects all sorts of things, like timeval and itimerval.  */
 
 extern struct timezone sys_tz;
-extern asmlinkage int sys_utimes(char *, struct timeval *);
 extern int do_adjtimex(struct timex *);
 
 struct timeval32
@@ -1315,8 +1314,6 @@ arch_get_unmapped_area(struct file *filp
 }
 
 #ifdef CONFIG_OSF4_COMPAT
-extern ssize_t sys_readv(unsigned long, const struct iovec *, unsigned long);
-extern ssize_t sys_writev(unsigned long, const struct iovec *, unsigned long);
 
 /* Clear top 32 bits of iov_len in the user's buffer for
    compatibility with old versions of OSF/1 where iov_len
diff -puN arch/ia64/ia32/ia32_ioctl.c~add-syscalls_h arch/ia64/ia32/ia32_ioctl.c
--- 25-x86_64/arch/ia64/ia32/ia32_ioctl.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/ia64/ia32/ia32_ioctl.c	Sat Feb 21 21:40:49 2004
@@ -8,6 +8,7 @@
  */
 
 #include <linux/signal.h>	/* argh, msdos_fs.h isn't self-contained... */
+#include <linux/syscalls.h>
 #include "ia32priv.h"
   
 #define	INCLUDES
@@ -26,8 +27,6 @@
 	_ret;						\
 })
 
-asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
 #define CODE
 #include "compat_ioctl.c"
 
diff -puN arch/ia64/ia32/sys_ia32.c~add-syscalls_h arch/ia64/ia32/sys_ia32.c
--- 25-x86_64/arch/ia64/ia32/sys_ia32.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/ia64/ia32/sys_ia32.c	Sat Feb 21 21:40:49 2004
@@ -15,6 +15,7 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
+#include <linux/syscalls.h>
 #include <linux/sysctl.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
@@ -55,6 +56,7 @@
 #include <asm/semaphore.h>
 #include <asm/types.h>
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 #include "ia32priv.h"
 
@@ -81,16 +83,9 @@
 #define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid))
 #define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid))
 
-extern asmlinkage long sys_execve (char *, char **, char **, struct pt_regs *);
-extern asmlinkage long sys_mprotect (unsigned long, size_t, unsigned long);
-extern asmlinkage long sys_munmap (unsigned long, size_t);
 extern unsigned long arch_get_unmapped_area (struct file *, unsigned long, unsigned long,
 					     unsigned long, unsigned long);
 
-/* forward declaration: */
-asmlinkage long sys32_mprotect (unsigned int, unsigned int, int);
-asmlinkage unsigned long sys_brk(unsigned long);
-
 /*
  * Anything that modifies or inspects ia32 user virtual memory must hold this semaphore
  * while doing so.
@@ -949,9 +944,6 @@ sys32_old_select (struct sel_arg_struct 
 			    (struct compat_timeval *) A(a.tvp));
 }
 
-asmlinkage ssize_t sys_readv (unsigned long,const struct iovec *,unsigned long);
-asmlinkage ssize_t sys_writev (unsigned long,const struct iovec *,unsigned long);
-
 static struct iovec *
 get_compat_iovec (struct compat_iovec *iov32, struct iovec *iov_buf, u32 count, int type)
 {
@@ -2023,9 +2015,6 @@ restore_ia32_fpxstate (struct task_struc
 	return 0;
 }
 
-extern asmlinkage long sys_ptrace (long, pid_t, unsigned long, unsigned long, long, long, long,
-				   long, long);
-
 /*
  *  Note that the IA32 version of `ptrace' calls the IA64 routine for
  *    many of the requests.  This will only work for requests that do
@@ -2284,8 +2273,6 @@ sys32_pause (void)
 	return -ERESTARTNOHAND;
 }
 
-asmlinkage long sys_msync (unsigned long start, size_t len, int flags);
-
 asmlinkage int
 sys32_msync (unsigned int start, unsigned int len, int flags)
 {
@@ -2307,8 +2294,6 @@ struct sysctl32 {
 	unsigned int	__unused[4];
 };
 
-extern asmlinkage long sys_sysctl(struct __sysctl_args *args);
-
 asmlinkage long
 sys32_sysctl (struct sysctl32 *args)
 {
@@ -2358,7 +2343,6 @@ sys32_sysctl (struct sysctl32 *args)
 asmlinkage long
 sys32_newuname (struct new_utsname *name)
 {
-	extern asmlinkage long sys_newuname(struct new_utsname * name);
 	int ret = sys_newuname(name);
 
 	if (!ret)
@@ -2367,8 +2351,6 @@ sys32_newuname (struct new_utsname *name
 	return ret;
 }
 
-extern asmlinkage long sys_getresuid (uid_t *ruid, uid_t *euid, uid_t *suid);
-
 asmlinkage long
 sys32_getresuid16 (u16 *ruid, u16 *euid, u16 *suid)
 {
@@ -2385,8 +2367,6 @@ sys32_getresuid16 (u16 *ruid, u16 *euid,
 	return ret;
 }
 
-extern asmlinkage long sys_getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid);
-
 asmlinkage long
 sys32_getresgid16 (u16 *rgid, u16 *egid, u16 *sgid)
 {
@@ -2407,8 +2387,6 @@ sys32_getresgid16 (u16 *rgid, u16 *egid,
 asmlinkage long
 sys32_lseek (unsigned int fd, int offset, unsigned int whence)
 {
-	extern off_t sys_lseek (unsigned int fd, off_t offset, unsigned int origin);
-
 	/* Sign-extension of "offset" is important here... */
 	return sys_lseek(fd, offset, whence);
 }
@@ -2497,16 +2475,12 @@ sys32_setgroups16 (int gidsetsize, short
 asmlinkage long
 sys32_truncate64 (unsigned int path, unsigned int len_lo, unsigned int len_hi)
 {
-	extern asmlinkage long sys_truncate (const char *path, unsigned long length);
-
 	return sys_truncate((const char *) A(path), ((unsigned long) len_hi << 32) | len_lo);
 }
 
 asmlinkage long
 sys32_ftruncate64 (int fd, unsigned int len_lo, unsigned int len_hi)
 {
-	extern asmlinkage long sys_ftruncate (int fd, unsigned long length);
-
 	return sys_ftruncate(fd, ((unsigned long) len_hi << 32) | len_lo);
 }
 
@@ -2595,7 +2569,6 @@ struct sysinfo32 {
 asmlinkage long
 sys32_sysinfo (struct sysinfo32 *info)
 {
-	extern asmlinkage long sys_sysinfo (struct sysinfo *);
 	struct sysinfo s;
 	long ret, err;
 	int bitcount = 0;
@@ -2647,7 +2620,6 @@ sys32_sysinfo (struct sysinfo32 *info)
 asmlinkage long
 sys32_sched_rr_get_interval (pid_t pid, struct compat_timespec *interval)
 {
-	extern asmlinkage long sys_sched_rr_get_interval (pid_t, struct timespec *);
 	mm_segment_t old_fs = get_fs();
 	struct timespec t;
 	long ret;
@@ -2663,21 +2635,18 @@ sys32_sched_rr_get_interval (pid_t pid, 
 asmlinkage long
 sys32_pread (unsigned int fd, void *buf, unsigned int count, u32 pos_lo, u32 pos_hi)
 {
-	extern asmlinkage long sys_pread64 (unsigned int, char *, size_t, loff_t);
 	return sys_pread64(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
 }
 
 asmlinkage long
 sys32_pwrite (unsigned int fd, void *buf, unsigned int count, u32 pos_lo, u32 pos_hi)
 {
-	extern asmlinkage long sys_pwrite64 (unsigned int, const char *, size_t, loff_t);
 	return sys_pwrite64(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
 }
 
 asmlinkage long
 sys32_sendfile (int out_fd, int in_fd, int *offset, unsigned int count)
 {
-	extern asmlinkage long sys_sendfile (int, int, off_t *, size_t);
 	mm_segment_t old_fs = get_fs();
 	long ret;
 	off_t of;
@@ -2698,7 +2667,6 @@ sys32_sendfile (int out_fd, int in_fd, i
 asmlinkage long
 sys32_personality (unsigned int personality)
 {
-	extern asmlinkage long sys_personality (unsigned long);
 	long ret;
 
 	if (current->personality == PER_LINUX32 && personality == PER_LINUX)
@@ -2990,8 +2958,6 @@ sys32_timer_create(u32 clock, struct sig
 	return err;
 }
 
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
-
 long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, 
 			__u32 len_low, __u32 len_high, int advice)
 { 
@@ -3090,9 +3056,6 @@ copy_mount_stuff_to_kernel(const void *u
 	return 0;
 }
 
-extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type,
-				unsigned long new_flags, void *data);
-
 #define SMBFS_NAME	"smbfs"
 #define NCPFS_NAME	"ncpfs"
 
@@ -3157,8 +3120,6 @@ sys32_mount(char *dev_name, char *dir_na
 	}
 }
 
-extern asmlinkage long sys_setreuid(uid_t ruid, uid_t euid);
-
 asmlinkage long sys32_setreuid(compat_uid_t ruid, compat_uid_t euid)
 {
 	uid_t sruid, seuid;
@@ -3168,8 +3129,6 @@ asmlinkage long sys32_setreuid(compat_ui
 	return sys_setreuid(sruid, seuid);
 }
 
-extern asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid);
-
 asmlinkage long
 sys32_setresuid(compat_uid_t ruid, compat_uid_t euid,
 		compat_uid_t suid)
@@ -3182,8 +3141,6 @@ sys32_setresuid(compat_uid_t ruid, compa
 	return sys_setresuid(sruid, seuid, ssuid);
 }
 
-extern asmlinkage long sys_setregid(gid_t rgid, gid_t egid);
-
 asmlinkage long
 sys32_setregid(compat_gid_t rgid, compat_gid_t egid)
 {
@@ -3194,8 +3151,6 @@ sys32_setregid(compat_gid_t rgid, compat
 	return sys_setregid(srgid, segid);
 }
 
-extern asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
-
 asmlinkage long
 sys32_setresgid(compat_gid_t rgid, compat_gid_t egid,
 		compat_gid_t sgid)
@@ -3325,8 +3280,6 @@ nfs_getfh32_res_trans(union nfsctl_res *
 	return err;
 }
 
-extern asmlinkage long sys_nfsservctl(int cmd, void *arg, void *resp);
-
 int asmlinkage
 sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
 {
diff -puN arch/mips/kernel/ioctl32.c~add-syscalls_h arch/mips/kernel/ioctl32.c
--- 25-x86_64/arch/mips/kernel/ioctl32.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/mips/kernel/ioctl32.c	Sat Feb 21 21:40:49 2004
@@ -61,6 +61,7 @@
 #include <linux/ethtool.h>
 #include <linux/mii.h>
 #include <linux/if_bonding.h>
+#include <linux/syscalls.h>
 #include <linux/watchdog.h>
 
 #include <asm/ioctls.h>
@@ -96,8 +97,6 @@
 #include <asm/sibyte/trace_prof.h>
 #endif
 
-long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
 static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
diff -puN arch/mips/kernel/irixioctl.c~add-syscalls_h arch/mips/kernel/irixioctl.c
--- 25-x86_64/arch/mips/kernel/irixioctl.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/mips/kernel/irixioctl.c	Sat Feb 21 21:40:49 2004
@@ -11,6 +11,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/sockios.h>
+#include <linux/syscalls.h>
 #include <linux/tty.h>
 #include <linux/file.h>
 
@@ -26,9 +27,6 @@ struct irix_termios {
 	cc_t c_cc[NCCS];
 };
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
-				unsigned long arg);
-extern asmlinkage int sys_write(unsigned int fd,char * buf,unsigned int count);
 extern void start_tty(struct tty_struct *tty);
 static struct tty_struct *get_tty(int fd)
 {
diff -puN arch/mips/kernel/linux32.c~add-syscalls_h arch/mips/kernel/linux32.c
--- 25-x86_64/arch/mips/kernel/linux32.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/mips/kernel/linux32.c	Sat Feb 21 21:40:49 2004
@@ -25,6 +25,7 @@
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/icmpv6.h>
+#include <linux/syscalls.h>
 #include <linux/sysctl.h>
 #include <linux/utime.h>
 #include <linux/utsname.h>
@@ -124,8 +125,6 @@ out:
 }
 
 
-asmlinkage long sys_truncate(const char * path, unsigned long length);
-
 asmlinkage int sys_truncate64(const char *path, unsigned int high,
 			      unsigned int low)
 {
@@ -134,8 +133,6 @@ asmlinkage int sys_truncate64(const char
 	return sys_truncate(path, ((long) high << 32) | low);
 }
 
-asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
-
 asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high,
 			       unsigned int low)
 {
@@ -413,8 +410,6 @@ xlate_dirent(void *dirent64, void *diren
 	return;
 }
 
-asmlinkage long sys_getdents(unsigned int fd, void * dirent, unsigned int count);
-
 asmlinkage long
 sys32_getdents(unsigned int fd, void * dirent32, unsigned int count)
 {
@@ -535,8 +530,6 @@ struct sysinfo32 {
 	char _f[8];
 };
 
-extern asmlinkage int sys_sysinfo(struct sysinfo *info);
-
 asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
 {
 	struct sysinfo s;
@@ -671,10 +664,6 @@ sys32_settimeofday(struct compat_timeval
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
-extern asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
-			          unsigned long offset_low, loff_t * result,
-			          unsigned int origin);
-
 asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
 			    unsigned int offset_low, loff_t * result,
 			    unsigned int origin)
@@ -1058,10 +1047,6 @@ out_nofds:
 }
 
 
-
-extern asmlinkage int sys_sched_rr_get_interval(pid_t pid,
-	struct timespec *interval);
-
 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
 	struct compat_timespec *interval)
 {
@@ -1741,8 +1726,6 @@ asmlinkage long sys32_newuname(struct ne
 	return ret;
 }
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage int sys32_personality(unsigned long personality)
 {
 	int ret;
@@ -1861,8 +1844,6 @@ asmlinkage int sys32_adjtimex(struct tim
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset,
 	s32 count)
 {
@@ -1883,8 +1864,6 @@ asmlinkage int sys32_sendfile(int out_fd
 	return ret;
 }
 
-asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-
 asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
                                    size_t count)
 {
diff -puN arch/mips/kernel/sysirix.c~add-syscalls_h arch/mips/kernel/sysirix.c
--- 25-x86_64/arch/mips/kernel/sysirix.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/mips/kernel/sysirix.c	Sat Feb 21 21:40:49 2004
@@ -29,6 +29,7 @@
 #include <linux/namei.h>
 #include <linux/socket.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 
 #include <asm/ptrace.h>
 #include <asm/page.h>
@@ -235,13 +236,6 @@ asmlinkage int irix_prctl(struct pt_regs
 #undef DEBUG_PROCGRPS
 
 extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt);
-extern asmlinkage int sys_setpgid(pid_t pid, pid_t pgid);
-extern void sys_sync(void);
-extern asmlinkage int sys_getsid(pid_t pid);
-extern asmlinkage long sys_write (unsigned int fd, const char *buf, unsigned long count);
-extern asmlinkage long sys_lseek (unsigned int fd, off_t offset, unsigned int origin);
-extern asmlinkage int sys_getgroups(int gidsetsize, gid_t *grouplist);
-extern asmlinkage int sys_setgroups(int gidsetsize, gid_t *grouplist);
 extern int getrusage(struct task_struct *p, int who, struct rusage *ru);
 extern char *prom_getenv(char *name);
 extern long prom_setenv(char *name, char *value);
@@ -694,9 +688,6 @@ asmlinkage int irix_pause(void)
 	return -EINTR;
 }
 
-extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type,
-				unsigned long new_flags, void * data);
-
 /* XXX need more than this... */
 asmlinkage int irix_mount(char *dev_name, char *dir_name, unsigned long flags,
 			  char *type, void *data, int datalen)
@@ -792,9 +783,6 @@ out:
 	return error;
 }
 
-extern asmlinkage int sys_setpgid(pid_t pid, pid_t pgid);
-extern asmlinkage int sys_setsid(void);
-
 asmlinkage int irix_setpgrp(int flags)
 {
 	int error;
@@ -883,8 +871,6 @@ asmlinkage unsigned long irix_sethostid(
 	return -EINVAL;
 }
 
-extern asmlinkage int sys_socket(int family, int type, int protocol);
-
 asmlinkage int irix_socket(int family, int type, int protocol)
 {
 	switch(type) {
@@ -1356,8 +1342,6 @@ asmlinkage int irix_fxstat(int version, 
 	return error;
 }
 
-extern asmlinkage int sys_mknod(const char * filename, int mode, unsigned dev);
-
 asmlinkage int irix_xmknod(int ver, char *filename, int mode, unsigned dev)
 {
 	int retval;
@@ -1501,9 +1485,6 @@ asmlinkage int irix_sigqueue(int pid, in
 	return -EINVAL;
 }
 
-extern asmlinkage int sys_truncate(const char * path, unsigned long length);
-extern asmlinkage int sys_ftruncate(unsigned int fd, unsigned long length);
-
 asmlinkage int irix_truncate64(char *name, int pad, int size1, int size2)
 {
 	int retval;
@@ -1532,10 +1513,6 @@ out:
 	return retval;
 }
 
-extern asmlinkage unsigned long
-sys_mmap(unsigned long addr, size_t len, int prot, int flags, int fd,
-         off_t offset);
-
 asmlinkage int irix_mmap64(struct pt_regs *regs)
 {
 	int len, prot, flags, fd, off1, off2, error, base = 0;
@@ -2106,9 +2083,6 @@ out:
 
 #undef DEBUG_FCNTL
 
-extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd,
-				 unsigned long arg);
-
 #define IRIX_F_ALLOCSP 10
 
 asmlinkage int irix_fcntl(int fd, int cmd, int arg)
diff -puN arch/parisc/hpux/ioctl.c~add-syscalls_h arch/parisc/hpux/ioctl.c
--- 25-x86_64/arch/parisc/hpux/ioctl.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/parisc/hpux/ioctl.c	Sat Feb 21 21:40:49 2004
@@ -35,13 +35,12 @@
 
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <asm/errno.h>
 #include <asm/ioctl.h>
 #include <asm/termios.h>
 #include <asm/uaccess.h>
 
-int sys_ioctl(unsigned int, unsigned int, unsigned long);
- 
 static int hpux_ioctl_t(int fd, unsigned long cmd, unsigned long arg)
 {
 	int result = -EOPNOTSUPP;
diff -puN arch/parisc/hpux/sys_hpux.c~add-syscalls_h arch/parisc/hpux/sys_hpux.c
--- 25-x86_64/arch/parisc/hpux/sys_hpux.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/parisc/hpux/sys_hpux.c	Sat Feb 21 21:40:49 2004
@@ -26,6 +26,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/utsname.h>
 #include <linux/vmalloc.h>
 #include <linux/vfs.h>
@@ -34,8 +35,6 @@
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 
-unsigned long sys_brk(unsigned long addr);
- 
 unsigned long hpux_brk(unsigned long addr)
 {
 	/* Sigh.  Looks like HP/UX libc relies on kernel bugs. */
@@ -61,7 +60,6 @@ int hpux_ptrace(void)
 
 int hpux_wait(int *stat_loc)
 {
-	extern int sys_waitpid(int, int *, int);
 	return sys_waitpid(-1, stat_loc, 0);
 }
 
@@ -213,7 +211,6 @@ int hpux_statfs(const char *path, struct
 	kfree(kpath);
 
 	/* just fake it, beginning of structures match */
-	extern int sys_statfs(const char *, struct statfs *);
 	error = sys_statfs(path, (struct statfs *) buf);
 
 	/* ignoring rest of statfs struct, but it should be zeros. Need to do 
@@ -269,9 +266,6 @@ static int hpux_uname(struct hpux_utsnam
 	return error;
 }
 
-int sys_sethostname(char *, int);
-int sys_gethostname(char *, int);
-
 /*  Note: HP-UX just uses the old suser() function to check perms
  *  in this system call.  We'll use capable(CAP_SYS_ADMIN).
  */
diff -puN arch/parisc/kernel/sys_parisc32.c~add-syscalls_h arch/parisc/kernel/sys_parisc32.c
--- 25-x86_64/arch/parisc/kernel/sys_parisc32.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/parisc/kernel/sys_parisc32.c	Sat Feb 21 21:40:49 2004
@@ -47,6 +47,7 @@
 #include <linux/vfs.h>
 #include <linux/ptrace.h>
 #include <linux/swap.h>
+#include <linux/syscalls.h>
 
 #include <asm/types.h>
 #include <asm/uaccess.h>
@@ -357,7 +358,6 @@ asmlinkage long sys32_sched_rr_get_inter
 {
 	struct timespec t;
 	int ret;
-	extern asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
 	
 	KERNEL_SYSCALL(ret, sys_sched_rr_get_interval, pid, &t);
 	if (put_compat_timespec(&t, interval))
@@ -1089,7 +1089,6 @@ asmlinkage long sys32_msgrcv(int msqid,
 }
 
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
 {
         mm_segment_t old_fs = get_fs();
@@ -1197,7 +1196,6 @@ asmlinkage int sys32_nfsservctl(int cmd,
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
 typedef long __kernel_loff_t32;		/* move this to asm/posix_types.h? */
 
 asmlinkage int sys32_sendfile64(int out_fd, int in_fd, __kernel_loff_t32 *offset, s32 count)
@@ -1345,8 +1343,6 @@ asmlinkage int sys32_sysinfo(struct sysi
  * half of the argument has been zeroed by syscall.S.
  */
 
-extern asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin);
-
 asmlinkage int sys32_lseek(unsigned int fd, int offset, unsigned int origin)
 {
 	return sys_lseek(fd, offset, origin);
@@ -1367,8 +1363,6 @@ asmlinkage long sys32_semctl(int semid, 
 	return sys_semctl (semid, semnum, cmd, arg);
 }
 
-extern long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len);
-
 long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf,
 			  size_t len)
 {
diff -puN arch/parisc/kernel/sys_parisc.c~add-syscalls_h arch/parisc/kernel/sys_parisc.c
--- 25-x86_64/arch/parisc/kernel/sys_parisc.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/parisc/kernel/sys_parisc.c	Sat Feb 21 21:40:49 2004
@@ -30,6 +30,7 @@
 #include <linux/mman.h>
 #include <linux/shm.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 int sys_pipe(int *fildes)
 {
@@ -182,10 +183,6 @@ long sys_shmat_wrapper(int shmid, char *
 /* Fucking broken ABI */
 
 #ifdef CONFIG_PARISC64
-extern asmlinkage long sys_truncate(const char *, unsigned long);
-extern asmlinkage long sys_ftruncate(unsigned int, unsigned long);
-extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long);
-
 asmlinkage long parisc_truncate64(const char * path,
 					unsigned int high, unsigned int low)
 {
@@ -214,9 +211,6 @@ asmlinkage long sys_fcntl64(unsigned int
 }
 #else
 
-extern asmlinkage long sys_truncate64(const char *, loff_t);
-extern asmlinkage long sys_ftruncate64(unsigned int, loff_t);
-
 asmlinkage long parisc_truncate64(const char * path,
 					unsigned int high, unsigned int low)
 {
@@ -230,12 +224,6 @@ asmlinkage long parisc_ftruncate64(unsig
 }
 #endif
 
-extern asmlinkage ssize_t sys_pread64(unsigned int fd, char *buf,
-					size_t count, loff_t pos);
-extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char *buf,
-					size_t count, loff_t pos);
-extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-
 asmlinkage ssize_t parisc_pread64(unsigned int fd, char *buf, size_t count,
 					unsigned int high, unsigned int low)
 {
@@ -257,7 +245,7 @@ asmlinkage ssize_t parisc_readahead(int 
 /*
  * This changes the io permissions bitmap in the current task.
  */
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
 {
 	return -ENOSYS;
 }
diff -puN arch/ppc64/kernel/ppc_ksyms.c~add-syscalls_h arch/ppc64/kernel/ppc_ksyms.c
--- 25-x86_64/arch/ppc64/kernel/ppc_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/ppc64/kernel/ppc_ksyms.c	Sat Feb 21 21:40:49 2004
@@ -20,6 +20,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 #include <asm/page.h>
 #include <asm/semaphore.h>
@@ -48,7 +49,6 @@
 #include <asm/iSeries/HvLpConfig.h>
 #endif
 
-extern int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
 extern int do_signal(sigset_t *, struct pt_regs *);
 
 int abs(int);
diff -puN arch/ppc64/kernel/sys_ppc32.c~add-syscalls_h arch/ppc64/kernel/sys_ppc32.c
--- 25-x86_64/arch/ppc64/kernel/sys_ppc32.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/ppc64/kernel/sys_ppc32.c	Sat Feb 21 21:40:49 2004
@@ -54,6 +54,8 @@
 #include <linux/ipv6.h>
 #include <linux/in.h>
 #include <linux/icmpv6.h>
+#include <linux/syscalls.h>
+#include <linux/unistd.h>
 #include <linux/sysctl.h>
 #include <linux/binfmts.h>
 #include <linux/dnotify.h>
@@ -65,6 +67,7 @@
 #include <asm/types.h>
 #include <asm/ipc.h>
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 #include <asm/semaphore.h>
 
@@ -778,8 +781,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-extern asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2);
-
 /* Note: it is necessary to treat option as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -1155,8 +1156,6 @@ struct sysinfo32 {
 	char _f[20-2*sizeof(int)-sizeof(int)];
 };
 
-extern asmlinkage long sys_sysinfo(struct sysinfo *info);
-
 asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
 {
 	struct sysinfo s;
@@ -1868,8 +1867,6 @@ asmlinkage long sys32_ipc(u32 call, u32 
 	return err;
 }
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
-
 /* Note: it is necessary to treat out_fd and in_fd as unsigned ints, 
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -1894,8 +1891,6 @@ asmlinkage long sys32_sendfile(u32 out_f
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
@@ -2158,9 +2153,6 @@ void start_thread32(struct pt_regs* regs
 #endif /* CONFIG_ALTIVEC */
 }
 
-extern asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
-				unsigned long arg4, unsigned long arg5);
-
 /* Note: it is necessary to treat option as an unsigned int, 
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2175,14 +2167,12 @@ asmlinkage long sys32_prctl(u32 option, 
 			 (unsigned long) arg5);
 }
 
-extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
-
 /* Note: it is necessary to treat pid as an unsigned int, 
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage int sys32_sched_rr_get_interval(u32 pid, struct compat_timespec *interval)
+asmlinkage long sys32_sched_rr_get_interval(u32 pid, struct compat_timespec *interval)
 {
 	struct timespec t;
 	int ret;
@@ -2196,9 +2186,6 @@ asmlinkage int sys32_sched_rr_get_interv
 	return ret;
 }
 
-extern asmlinkage int sys_pciconfig_read(unsigned long bus, unsigned long dfn, unsigned long off,
-					 unsigned long len, unsigned char *buf);
-
 asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
 {
 	return sys_pciconfig_read((unsigned long) bus,
@@ -2208,12 +2195,6 @@ asmlinkage int sys32_pciconfig_read(u32 
 				  (unsigned char *)AA(ubuf));
 }
 
-
-
-
-extern asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn, unsigned long off,
-					  unsigned long len, unsigned char *buf);
-
 asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
 {
 	return sys_pciconfig_write((unsigned long) bus,
@@ -2281,8 +2262,6 @@ asmlinkage int sys32_pciconfig_iobase(u3
 }
 
 
-extern asmlinkage int sys_newuname(struct new_utsname * name);
-
 asmlinkage int ppc64_newuname(struct new_utsname * name)
 {
 	int errno = sys_newuname(name);
@@ -2295,8 +2274,6 @@ asmlinkage int ppc64_newuname(struct new
 	return errno;
 }
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage int ppc64_personality(unsigned long personality)
 {
 	int ret;
@@ -2310,8 +2287,6 @@ asmlinkage int ppc64_personality(unsigne
 
 
 
-extern asmlinkage long sys_access(const char * filename, int mode);
-
 /* Note: it is necessary to treat mode as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2323,8 +2298,6 @@ asmlinkage long sys32_access(const char 
 }
 
 
-extern asmlinkage long sys_creat(const char * pathname, int mode);
-
 /* Note: it is necessary to treat mode as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2336,8 +2309,6 @@ asmlinkage long sys32_creat(const char *
 }
 
 
-extern asmlinkage long sys_waitpid(pid_t pid, unsigned int * stat_addr, int options);
-
 /* Note: it is necessary to treat pid and options as unsigned ints,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2349,8 +2320,6 @@ asmlinkage long sys32_waitpid(u32 pid, u
 }
 
 
-extern asmlinkage long sys_getgroups(int gidsetsize, gid_t *grouplist);
-
 /* Note: it is necessary to treat gidsetsize as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2362,8 +2331,6 @@ asmlinkage long sys32_getgroups(u32 gids
 }
 
 
-extern asmlinkage long sys_getpgid(pid_t pid);
-
 /* Note: it is necessary to treat pid as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2375,8 +2342,6 @@ asmlinkage long sys32_getpgid(u32 pid)
 }
 
 
-extern asmlinkage long sys_getpriority(int which, int who);
-
 /* Note: it is necessary to treat which and who as unsigned ints,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2388,8 +2353,6 @@ asmlinkage long sys32_getpriority(u32 wh
 }
 
 
-extern asmlinkage long sys_getsid(pid_t pid);
-
 /* Note: it is necessary to treat pid as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2400,7 +2363,6 @@ asmlinkage long sys32_getsid(u32 pid)
 	return sys_getsid((int)pid);
 }
 
-extern asmlinkage long sys_kill(int pid, int sig);
 
 /* Note: it is necessary to treat pid and sig as unsigned ints,
  * with the corresponding cast to a signed int to insure that the 
@@ -2413,8 +2375,6 @@ asmlinkage long sys32_kill(u32 pid, u32 
 }
 
 
-extern asmlinkage long sys_mkdir(const char * pathname, int mode);
-
 /* Note: it is necessary to treat mode as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2425,16 +2385,12 @@ asmlinkage long sys32_mkdir(const char *
 	return sys_mkdir(pathname, (int)mode);
 }
 
-extern asmlinkage long sys_nice(int increment);
-
 long sys32_nice(u32 increment)
 {
 	/* sign extend increment */
 	return sys_nice((int)increment);
 }
 
-extern off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin);
-
 off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
 {
 	/* sign extend n */
@@ -2472,8 +2428,6 @@ out_error:
 	goto out;
 }
 
-extern asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz);
-
 /* Note: it is necessary to treat bufsiz as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2484,8 +2438,6 @@ asmlinkage long sys32_readlink(const cha
 	return sys_readlink(path, buf, (int)bufsiz);
 }
 
-extern asmlinkage long sys_sched_get_priority_max(int policy);
-
 /* Note: it is necessary to treat option as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2497,8 +2449,6 @@ asmlinkage long sys32_sched_get_priority
 }
 
 
-extern asmlinkage long sys_sched_get_priority_min(int policy);
-
 /* Note: it is necessary to treat policy as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2510,8 +2460,6 @@ asmlinkage long sys32_sched_get_priority
 }
 
 
-extern asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param);
-
 /* Note: it is necessary to treat pid as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2523,8 +2471,6 @@ asmlinkage long sys32_sched_getparam(u32
 }
 
 
-extern asmlinkage long sys_sched_getscheduler(pid_t pid);
-
 /* Note: it is necessary to treat pid as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2536,8 +2482,6 @@ asmlinkage long sys32_sched_getscheduler
 }
 
 
-extern asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param *param);
-
 /* Note: it is necessary to treat pid as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2549,8 +2493,6 @@ asmlinkage long sys32_sched_setparam(u32
 }
 
 
-extern asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, struct sched_param *param);
-
 /* Note: it is necessary to treat pid and policy as unsigned ints,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2562,8 +2504,6 @@ asmlinkage long sys32_sched_setscheduler
 }
 
 
-extern asmlinkage long sys_setdomainname(char *name, int len);
-
 /* Note: it is necessary to treat len as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2575,8 +2515,6 @@ asmlinkage long sys32_setdomainname(char
 }
 
 
-extern asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist);
-
 /* Note: it is necessary to treat gidsetsize as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2588,8 +2526,6 @@ asmlinkage long sys32_setgroups(u32 gids
 }
 
 
-extern asmlinkage long sys_sethostname(char *name, int len);
-
 asmlinkage long sys32_sethostname(char *name, u32 len)
 {
 	/* sign extend len */
@@ -2597,8 +2533,6 @@ asmlinkage long sys32_sethostname(char *
 }
 
 
-extern asmlinkage long sys_setpgid(pid_t pid, pid_t pgid);
-
 /* Note: it is necessary to treat pid and pgid as unsigned ints,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2610,16 +2544,12 @@ asmlinkage long sys32_setpgid(u32 pid, u
 }
 
 
-extern asmlinkage long sys_setpriority(int which, int who, int niceval);
-
 long sys32_setpriority(u32 which, u32 who, u32 niceval)
 {
 	/* sign extend which, who and niceval */
 	return sys_setpriority((int)which, (int)who, (int)niceval);
 }
 
-extern asmlinkage long sys_ssetmask(int newmask);
-
 /* Note: it is necessary to treat newmask as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2630,8 +2560,6 @@ asmlinkage long sys32_ssetmask(u32 newma
 	return sys_ssetmask((int) newmask);
 }
 
-extern asmlinkage long sys_syslog(int type, char * buf, int len);
-
 long sys32_syslog(u32 type, char * buf, u32 len)
 {
 	/* sign extend len */
@@ -2639,8 +2567,6 @@ long sys32_syslog(u32 type, char * buf, 
 }
 
 
-extern asmlinkage long sys_umask(int mask);
-
 /* Note: it is necessary to treat mask as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2652,8 +2578,6 @@ asmlinkage long sys32_umask(u32 mask)
 }
 
 
-extern asmlinkage long sys_umount(char * name, int flags);
-
 /* Note: it is necessary to treat flags as an unsigned int,
  * with the corresponding cast to a signed int to insure that the 
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -2756,10 +2680,6 @@ int sys32_olduname(struct oldold_utsname
 	return error;
 }
 
-extern unsigned long sys_mmap(unsigned long addr, size_t len,
-			      unsigned long prot, unsigned long flags,
-			      unsigned long fd, off_t offset);
-
 unsigned long sys32_mmap2(unsigned long addr, size_t len,
 			  unsigned long prot, unsigned long flags,
 			  unsigned long fd, unsigned long pgoff)
@@ -2801,8 +2721,6 @@ long sys32_utimes(char *filename, struct
 	return ret;
 }
 
-extern long sys_tgkill(int tgid, int pid, int sig);
-
 long sys32_tgkill(u32 tgid, u32 pid, int sig)
 {
 	/* sign extend tgid, pid */
@@ -2813,11 +2731,6 @@ long sys32_tgkill(u32 tgid, u32 pid, int
  * long long munging:
  * The 32 bit ABI passes long longs in an odd even register pair.
  */
-extern ssize_t sys_pread64(unsigned int fd, char *buf, size_t count,
-			   loff_t pos);
-
-extern ssize_t sys_pwrite64(unsigned int fd, const char *buf, size_t count,
-			    loff_t pos);
 
 compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf, compat_size_t count,
 			     u32 reg6, u32 poshi, u32 poslo)
@@ -2831,16 +2744,11 @@ compat_ssize_t sys32_pwrite64(unsigned i
 	return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
 }
 
-extern ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-
 compat_ssize_t sys32_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
 {
 	return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
 }
 
-extern asmlinkage long sys_truncate(const char * path, unsigned long length);
-extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
-
 asmlinkage int sys32_truncate64(const char * path, u32 reg4,
 				unsigned long high, unsigned long low)
 {
@@ -2853,8 +2761,6 @@ asmlinkage int sys32_ftruncate64(unsigne
 	return sys_ftruncate(fd, (high << 32) | low);
 }
 
-extern long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len);
-
 long ppc32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf,
 			  size_t len)
 {
@@ -2862,8 +2768,6 @@ long ppc32_lookup_dcookie(u32 cookie_hig
 				  buf, len);
 }
 
-extern int sys_fadvise64(int fd, loff_t offset, size_t len, int advice);
-
 long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
 		     size_t len, int advice)
 {
diff -puN arch/s390/kernel/compat_linux.c~add-syscalls_h arch/s390/kernel/compat_linux.c
--- 25-x86_64/arch/s390/kernel/compat_linux.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/s390/kernel/compat_linux.c	Sat Feb 21 21:40:49 2004
@@ -55,6 +55,7 @@
 #include <linux/ipv6.h>
 #include <linux/in.h>
 #include <linux/icmpv6.h>
+#include <linux/syscalls.h>
 #include <linux/sysctl.h>
 #include <linux/binfmts.h>
 #include <linux/compat.h>
@@ -71,17 +72,6 @@
 
 #include "compat_linux.h"
 
-extern asmlinkage long sys_chown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_lchown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_fchown(unsigned int, uid_t,gid_t);
-extern asmlinkage long sys_setregid(gid_t, gid_t);
-extern asmlinkage long sys_setgid(gid_t);
-extern asmlinkage long sys_setreuid(uid_t, uid_t);
-extern asmlinkage long sys_setuid(uid_t);
-extern asmlinkage long sys_setresuid(uid_t, uid_t, uid_t);
-extern asmlinkage long sys_setresgid(gid_t, gid_t, gid_t);
-extern asmlinkage long sys_setfsuid(uid_t);
-extern asmlinkage long sys_setfsgid(gid_t);
  
 /* For this source file, we want overflow handling. */
 
@@ -925,9 +915,6 @@ out:
 	return err;
 }
 
-extern asmlinkage long sys_truncate(const char * path, unsigned long length);
-extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
-
 asmlinkage int sys32_truncate64(const char * path, unsigned long high, unsigned long low)
 {
 	if ((int)high < 0)
@@ -1397,8 +1384,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-extern asmlinkage int sys_sysfs(int option, unsigned long arg1, unsigned long arg2);
-
 asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2)
 {
 	return sys_sysfs(option, arg1, arg2);
@@ -1572,9 +1557,7 @@ struct sysinfo32 {
         char _f[8];
 };
 
-extern asmlinkage int sys_sysinfo(struct sysinfo *info);
-
-asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
+asmlinkage int sys32_sysinfo(struct sysinfo32 __user *info)
 {
 	struct sysinfo s;
 	int ret, err;
@@ -1602,10 +1585,8 @@ asmlinkage int sys32_sysinfo(struct sysi
 	return ret;
 }
 
-extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
-
 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
-		struct compat_timespec *interval)
+				struct compat_timespec __user *interval)
 {
 	struct timespec t;
 	int ret;
@@ -1619,9 +1600,8 @@ asmlinkage int sys32_sched_rr_get_interv
 	return ret;
 }
 
-extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize);
-
-asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize)
+asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
+			compat_sigset_t __user *oset, compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1655,9 +1635,8 @@ asmlinkage int sys32_rt_sigprocmask(int 
 	return 0;
 }
 
-extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-
-asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
+asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *set,
+				compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1764,11 +1743,8 @@ sys32_rt_sigtimedwait(compat_sigset_t *u
 	return ret;
 }
 
-extern asmlinkage int
-sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
-
 asmlinkage int
-sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
+sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo)
 {
 	siginfo_t info;
 	int ret;
@@ -1997,40 +1973,30 @@ out:
 
 #ifdef CONFIG_MODULES
 
-extern asmlinkage int sys_init_module(const char *name_user, struct module *mod_user);
-
-/* Hey, when you're trying to init module, take time and prepare us a nice 64bit
- * module structure, even if from 32bit modutils... Why to pollute kernel... :))
- */
-asmlinkage int sys32_init_module(const char *name_user, struct module *mod_user)
+asmlinkage int
+sys32_init_module(void __user *umod, unsigned long len,
+		const char __user *uargs)
 {
-	return sys_init_module(name_user, mod_user);
+	return sys_init_module(umod, len, uargs);
 }
 
-extern asmlinkage int sys_delete_module(const char *name_user);
-
-asmlinkage int sys32_delete_module(const char *name_user)
+asmlinkage int
+sys32_delete_module(const char __user *name_user, unsigned int flags)
 {
-	return sys_delete_module(name_user);
+	return sys_delete_module(name_user, flags);
 }
 
-struct module_info32 {
-	u32 addr;
-	u32 size;
-	u32 flags;
-	s32 usecount;
-};
-
 #else /* CONFIG_MODULES */
 
 asmlinkage int
-sys32_init_module(const char *name_user, struct module *mod_user)
+sys32_init_module(void __user *umod, unsigned long len,
+		const char __user *uargs)
 {
 	return -ENOSYS;
 }
 
 asmlinkage int
-sys32_delete_module(const char *name_user)
+sys32_delete_module(const char __user *name_user, unsigned int flags)
 {
 	return -ENOSYS;
 }
@@ -2194,10 +2160,6 @@ static int nfs_getfh32_res_trans(union n
 	return copy_to_user(res32, kres, sizeof(*res32)) ? -EFAULT : 0;
 }
 
-/*
-asmlinkage long sys_ni_syscall(void); 
-*/
-
 int asmlinkage sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
 {
 	struct nfsctl_arg *karg = NULL;
@@ -2312,9 +2274,8 @@ asmlinkage int sys32_settimeofday(struct
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
-asmlinkage int sys_utimes(char *, struct timeval *);
-
-asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs)
+asmlinkage int sys32_utimes(char __user *filename,
+			struct compat_timeval __user *tvs)
 {
 	char *kfilename;
 	struct timeval ktvs[2];
@@ -2348,8 +2309,6 @@ asmlinkage int sys32_pause(void)
 	return -ERESTARTNOHAND;
 }
 
-extern asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
-				unsigned long arg4, unsigned long arg5);
 
 asmlinkage int sys32_prctl(int option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
 {
@@ -2361,12 +2320,6 @@ asmlinkage int sys32_prctl(int option, u
 }
 
 
-extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
-				    size_t count, loff_t pos);
-
-extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
-				     size_t count, loff_t pos);
-
 asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf,
 				 compat_size_t count, u32 poshi, u32 poslo)
 {
@@ -2383,15 +2336,11 @@ asmlinkage compat_ssize_t sys32_pwrite64
 	return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
 }
 
-extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-
 asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count)
 {
 	return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count);
 }
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
@@ -2411,9 +2360,6 @@ asmlinkage int sys32_sendfile(int out_fd
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, 
-					 loff_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile64(int out_fd, int in_fd, 
 				compat_loff_t *offset, s32 count)
 {
@@ -2507,8 +2453,6 @@ asmlinkage int sys32_adjtimex(struct tim
 	return ret;
 }
 
-extern asmlinkage long sys_setpriority(int which, int who, int niceval);
-
 asmlinkage int sys_setpriority32(u32 which, u32 who, u32 niceval)
 {
 	return sys_setpriority((int) which,
@@ -2526,7 +2470,7 @@ struct __sysctl_args32 {
 	u32 __unused[4];
 };
 
-extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
+asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 {
 	struct __sysctl_args32 tmp;
 	int error;
@@ -2718,8 +2662,6 @@ out:
 	return error;
 }
 
-asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count);
-
 asmlinkage compat_ssize_t sys32_read(unsigned int fd, char * buf, size_t count)
 {
 	if ((compat_ssize_t) count < 0)
@@ -2728,8 +2670,6 @@ asmlinkage compat_ssize_t sys32_read(uns
 	return sys_read(fd, buf, count);
 }
 
-asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count);
-
 asmlinkage compat_ssize_t sys32_write(unsigned int fd, char * buf, size_t count)
 {
 	if ((compat_ssize_t) count < 0)
diff -puN arch/s390/kernel/compat_linux.h~add-syscalls_h arch/s390/kernel/compat_linux.h
--- 25-x86_64/arch/s390/kernel/compat_linux.h~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/s390/kernel/compat_linux.h	Sat Feb 21 21:40:49 2004
@@ -4,6 +4,7 @@
 #include <linux/config.h>
 #include <linux/compat.h>
 #include <linux/socket.h>
+#include <linux/syscalls.h>
 #include <linux/nfs_fs.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
diff -puN arch/s390/kernel/sys_s390.c~add-syscalls_h arch/s390/kernel/sys_s390.c
--- 25-x86_64/arch/s390/kernel/sys_s390.c~add-syscalls_h	Sat Feb 21 21:40:48 2004
+++ 25-x86_64-akpm/arch/s390/kernel/sys_s390.c	Sat Feb 21 21:40:49 2004
@@ -21,6 +21,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -125,8 +126,6 @@ out:
 	return error;
 }
 
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-
 #ifndef CONFIG_ARCH_S390X
 struct sel_arg_struct {
 	unsigned long n;
@@ -290,15 +289,13 @@ asmlinkage int sys_olduname(struct oldol
 	return error;
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on)
 {
 	return -ENOSYS;
 }
 
 #else /* CONFIG_ARCH_S390X */
 
-extern asmlinkage int sys_newuname(struct new_utsname * name);
-
 asmlinkage int s390x_newuname(struct new_utsname * name)
 {
 	int ret = sys_newuname(name);
@@ -310,8 +307,6 @@ asmlinkage int s390x_newuname(struct new
 	return ret;
 }
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage int s390x_personality(unsigned long personality)
 {
 	int ret;
@@ -331,8 +326,6 @@ asmlinkage int s390x_personality(unsigne
  */
 #ifndef CONFIG_ARCH_S390X
 
-extern asmlinkage long sys_fadvise64(int, loff_t, size_t, int);
-
 asmlinkage long
 s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice)
 {
@@ -342,8 +335,6 @@ s390_fadvise64(int fd, u32 offset_high, 
 
 #endif
 
-extern asmlinkage long sys_fadvise64_64(int, loff_t, loff_t, int);
-
 struct fadvise64_64_args {
 	int fd;
 	long long offset;
diff -puN arch/sparc64/kernel/sparc64_ksyms.c~add-syscalls_h arch/sparc64/kernel/sparc64_ksyms.c
--- 25-x86_64/arch/sparc64/kernel/sparc64_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/sparc64_ksyms.c	Sat Feb 21 21:40:49 2004
@@ -22,6 +22,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/socket.h>
+#include <linux/syscalls.h>
 #include <linux/percpu.h>
 #include <net/compat.h>
 
@@ -84,21 +85,13 @@ extern void syscall_trace(void);
 extern u32 sunos_sys_table[], sys_call_table32[];
 extern void tl0_solaris(void);
 extern void sys_sigsuspend(void);
-extern int sys_getppid(void);
-extern int sys_getpid(void);
-extern int sys_geteuid(void);
-extern int sys_getuid(void);
-extern int sys_getegid(void);
-extern int sys_getgid(void);
 extern int svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
 extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
-extern int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
 extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
 extern long sparc32_open(const char * filename, int flags, int mode);
 extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space);
-extern long sys_close(unsigned int);
-                
+
 extern int __ashrdi3(int, int);
 
 extern void dump_thread(struct pt_regs *, struct user *);
diff -puN arch/sparc64/kernel/sunos_ioctl32.c~add-syscalls_h arch/sparc64/kernel/sunos_ioctl32.c
--- 25-x86_64/arch/sparc64/kernel/sunos_ioctl32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/sunos_ioctl32.c	Sat Feb 21 21:40:49 2004
@@ -22,6 +22,7 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <asm/kbio.h>
 
@@ -90,8 +91,6 @@ struct ifconf32 {
         compat_caddr_t  ifcbuf;
 };
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
 extern asmlinkage int compat_sys_ioctl(unsigned int, unsigned int, u32);
 extern asmlinkage int sys_setsid(void);
 
diff -puN arch/sparc64/kernel/sys_sparc32.c~add-syscalls_h arch/sparc64/kernel/sys_sparc32.c
--- 25-x86_64/arch/sparc64/kernel/sys_sparc32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/sys_sparc32.c	Sat Feb 21 21:40:49 2004
@@ -47,6 +47,7 @@
 #include <linux/ipv6.h>
 #include <linux/in.h>
 #include <linux/icmpv6.h>
+#include <linux/syscalls.h>
 #include <linux/sysctl.h>
 #include <linux/binfmts.h>
 #include <linux/dnotify.h>
@@ -88,17 +89,6 @@
 	__ret;				\
 })
 
-extern asmlinkage long sys_chown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_lchown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_fchown(unsigned int, uid_t,gid_t);
-extern asmlinkage long sys_setregid(gid_t, gid_t);
-extern asmlinkage long sys_setgid(gid_t);
-extern asmlinkage long sys_setreuid(uid_t, uid_t);
-extern asmlinkage long sys_setuid(uid_t);
-extern asmlinkage long sys_setresuid(uid_t, uid_t, uid_t);
-extern asmlinkage long sys_setresgid(gid_t, gid_t, gid_t);
-extern asmlinkage long sys_setfsuid(uid_t);
-extern asmlinkage long sys_setfsgid(gid_t);
  
 asmlinkage long sys32_chown16(const char * filename, u16 user, u16 group)
 {
@@ -292,9 +282,7 @@ static inline long put_tv32(struct compa
 		 __put_user(i->tv_usec, &o->tv_usec)));
 }
 
-extern asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
-
-asmlinkage int sys32_ioperm(u32 from, u32 num, int on)
+asmlinkage long sys32_ioperm(u32 from, u32 num, int on)
 {
 	return sys_ioperm((unsigned long)from, (unsigned long)num, on);
 }
@@ -836,9 +824,6 @@ out:
 	return err;
 }
 
-extern asmlinkage long sys_truncate(const char * path, unsigned long length);
-extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
-
 asmlinkage int sys32_truncate64(const char * path, unsigned long high, unsigned long low)
 {
 	if ((int)high < 0)
@@ -1344,8 +1329,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-extern asmlinkage int sys_sysfs(int option, unsigned long arg1, unsigned long arg2);
-
 asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2)
 {
 	return sys_sysfs(option, arg1, arg2);
@@ -1571,8 +1554,6 @@ struct sysinfo32 {
 	char _f[20-2*sizeof(int)-sizeof(int)];
 };
 
-extern asmlinkage int sys_sysinfo(struct sysinfo *info);
-
 asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
 {
 	struct sysinfo s;
@@ -1620,8 +1601,6 @@ asmlinkage int sys32_sysinfo(struct sysi
 	return ret;
 }
 
-extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
-
 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
 {
 	struct timespec t;
@@ -1636,8 +1615,6 @@ asmlinkage int sys32_sched_rr_get_interv
 	return ret;
 }
 
-extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize);
-
 asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize)
 {
 	sigset_t s;
@@ -1672,8 +1649,6 @@ asmlinkage int sys32_rt_sigprocmask(int 
 	return 0;
 }
 
-extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-
 asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
 {
 	sigset_t s;
@@ -1781,9 +1756,6 @@ sys32_rt_sigtimedwait(compat_sigset_t *u
 	return ret;
 }
 
-extern asmlinkage int
-sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
-
 asmlinkage int
 sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 {
@@ -2114,15 +2086,11 @@ out:
 
 #ifdef CONFIG_MODULES
 
-extern asmlinkage long sys_init_module(void *, unsigned long, const char *);
-
 asmlinkage int sys32_init_module(void *umod, u32 len, const char *uargs)
 {
 	return sys_init_module(umod, len, uargs);
 }
 
-extern asmlinkage long sys_delete_module(const char *, unsigned int);
-
 asmlinkage int sys32_delete_module(const char *name_user, unsigned int flags)
 {
 	return sys_delete_module(name_user, flags);
@@ -2364,7 +2332,6 @@ done:
 	return err;
 }
 #else /* !NFSD */
-extern asmlinkage long sys_ni_syscall(void);
 int asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2)
 {
 	return sys_ni_syscall();
@@ -2457,17 +2424,6 @@ asmlinkage int sys32_pause(void)
 }
 
 /* PCI config space poking. */
-extern asmlinkage int sys_pciconfig_read(unsigned long bus,
-					 unsigned long dfn,
-					 unsigned long off,
-					 unsigned long len,
-					 unsigned char *buf);
-
-extern asmlinkage int sys_pciconfig_write(unsigned long bus,
-					  unsigned long dfn,
-					  unsigned long off,
-					  unsigned long len,
-					  unsigned char *buf);
 
 asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
 {
@@ -2487,9 +2443,6 @@ asmlinkage int sys32_pciconfig_write(u32
 				   (unsigned char *)AA(ubuf));
 }
 
-extern asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
-				unsigned long arg4, unsigned long arg5);
-
 asmlinkage int sys32_prctl(int option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
 {
 	return sys_prctl(option,
@@ -2500,12 +2453,6 @@ asmlinkage int sys32_prctl(int option, u
 }
 
 
-extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
-				    size_t count, loff_t pos);
-
-extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
-				     size_t count, loff_t pos);
-
 asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf,
 				   compat_size_t count, u32 poshi, u32 poslo)
 {
@@ -2518,8 +2465,6 @@ asmlinkage compat_ssize_t sys32_pwrite64
 	return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
 }
 
-extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-
 asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count)
 {
 	return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count);
@@ -2536,8 +2481,6 @@ long sys32_fadvise64_64(int fd, u32 offh
 				((loff_t)AA(lenhi)<<32)|AA(lenlo), advice);
 }
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
@@ -2557,8 +2500,6 @@ asmlinkage int sys32_sendfile(int out_fd
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
-
 asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
@@ -2733,8 +2674,6 @@ out:
 	return ret;       
 }
 
-extern asmlinkage long sys_setpriority(int which, int who, int niceval);
-
 asmlinkage int sys_setpriority32(u32 which, u32 who, u32 niceval)
 {
 	return sys_setpriority((int) which,
@@ -2794,8 +2733,6 @@ asmlinkage long sys32_sysctl(struct __sy
 #endif
 }
 
-extern long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len);
-
 long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf, size_t len)
 {
 	return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
diff -puN arch/sparc64/kernel/sys_sparc.c~add-syscalls_h arch/sparc64/kernel/sys_sparc.c
--- 25-x86_64/arch/sparc64/kernel/sys_sparc.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/sys_sparc.c	Sat Feb 21 21:40:49 2004
@@ -22,6 +22,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/slab.h>
+#include <linux/syscalls.h>
 #include <linux/ipc.h>
 #include <linux/personality.h>
 
@@ -161,8 +162,6 @@ unsigned long get_fb_unmapped_area(struc
 	return addr;
 }
 
-extern asmlinkage unsigned long sys_brk(unsigned long brk);
-
 asmlinkage unsigned long sparc_brk(unsigned long brk)
 {
 	/* People could try to be nasty and use ta 0x6d in 32bit programs */
@@ -280,8 +279,6 @@ out:
 	return err;
 }
 
-extern asmlinkage int sys_newuname(struct new_utsname __user *name);
-
 asmlinkage int sparc64_newuname(struct new_utsname __user *name)
 {
 	int ret = sys_newuname(name);
@@ -292,8 +289,6 @@ asmlinkage int sparc64_newuname(struct n
 	return ret;
 }
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage int sparc64_personality(unsigned long personality)
 {
 	int ret;
diff -puN arch/sparc64/kernel/sys_sunos32.c~add-syscalls_h arch/sparc64/kernel/sys_sunos32.c
--- 25-x86_64/arch/sparc64/kernel/sys_sunos32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/sys_sunos32.c	Sat Feb 21 21:40:49 2004
@@ -33,6 +33,7 @@
 #include <linux/errno.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 #include <asm/uaccess.h>
 #include <asm/page.h>
@@ -584,11 +585,6 @@ struct sunos_nfs_mount_args {
 	char       *netname;   /* server's netname */
 };
 
-extern asmlinkage int sys_mount(char *, char *, char *, unsigned long, void *);
-extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen);
-extern asmlinkage int sys_socket(int family, int type, int protocol);
-extern asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen);
-
 
 /* Bind the socket on a local reserved port and connect it to the
  * remote server.  This on Linux/i386 is done by the mount program,
@@ -781,8 +777,6 @@ out:
 	return ret;
 }
 
-extern asmlinkage int sys_setsid(void);
-extern asmlinkage int sys_setpgid(pid_t, pid_t);
 
 asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 {
@@ -1200,11 +1194,6 @@ static inline int check_nonblock(int ret
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_read(unsigned int fd, char *buf, unsigned long count);
-extern asmlinkage ssize_t sys_write(unsigned int fd, char *buf, unsigned long count);
-extern asmlinkage int sys_recv(int fd, void *ubuf, size_t size, unsigned flags);
-extern asmlinkage int sys_send(int fd, void *buff, size_t len, unsigned flags);
-extern asmlinkage int sys_accept(int fd, struct sockaddr *sa, int *addrlen);
 extern asmlinkage int sys32_readv(u32 fd, u32 vector, s32 count);
 extern asmlinkage int sys32_writev(u32 fd, u32 vector, s32 count);
 
@@ -1302,9 +1291,6 @@ asmlinkage int sunos_sigaction (int sig,
 	return ret;
 }
 
-extern asmlinkage int sys_setsockopt(int fd, int level, int optname,
-				     char *optval, int optlen);
-
 asmlinkage int sunos_setsockopt(int fd, int level, int optname, u32 optval,
 				int optlen)
 {
diff -puN arch/sparc64/solaris/ioctl.c~add-syscalls_h arch/sparc64/solaris/ioctl.c
--- 25-x86_64/arch/sparc64/solaris/ioctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/solaris/ioctl.c	Sat Feb 21 21:40:49 2004
@@ -17,6 +17,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/ioctl.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -34,8 +35,6 @@
 #include "conv.h"
 #include "socksys.h"
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, 
-	unsigned long arg);
 extern asmlinkage int compat_sys_ioctl(unsigned int fd, unsigned int cmd,
 	u32 arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
diff -puN arch/sparc64/solaris/socksys.c~add-syscalls_h arch/sparc64/solaris/socksys.c
--- 25-x86_64/arch/sparc64/solaris/socksys.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/solaris/socksys.c	Sat Feb 21 21:40:49 2004
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/slab.h>
+#include <linux/syscalls.h>
 #include <linux/in.h>
 #include <linux/devfs_fs_kernel.h>
 
@@ -35,9 +36,6 @@
 #include "conv.h"
 #include "socksys.h"
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, 
-	unsigned long arg);
-	
 static int af_inet_protocols[] = {
 IPPROTO_ICMP, IPPROTO_ICMP, IPPROTO_IGMP, IPPROTO_IPIP, IPPROTO_TCP,
 IPPROTO_EGP, IPPROTO_PUP, IPPROTO_UDP, IPPROTO_IDP, IPPROTO_RAW,
diff -puN arch/sparc64/solaris/timod.c~add-syscalls_h arch/sparc64/solaris/timod.c
--- 25-x86_64/arch/sparc64/solaris/timod.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/solaris/timod.c	Sat Feb 21 21:40:49 2004
@@ -27,8 +27,6 @@
 #include "conv.h"
 #include "socksys.h"
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, 
-	unsigned long arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 
 static spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED;
diff -puN arch/sparc/kernel/sunos_ioctl.c~add-syscalls_h arch/sparc/kernel/sunos_ioctl.c
--- 25-x86_64/arch/sparc/kernel/sunos_ioctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc/kernel/sunos_ioctl.c	Sat Feb 21 21:40:49 2004
@@ -21,6 +21,7 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/file.h>
 #include <asm/kbio.h>
 
@@ -32,7 +33,6 @@ extern char sunkbd_layout;
 /* NR_OPEN is now larger and dynamic in recent kernels. */
 #define SUNOS_NR_OPEN	256
 
-extern asmlinkage int sys_ioctl(unsigned int, unsigned int, unsigned long);
 extern asmlinkage int sys_setsid(void);
 
 asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
diff -puN arch/sparc/kernel/sys_sunos.c~add-syscalls_h arch/sparc/kernel/sys_sunos.c
--- 25-x86_64/arch/sparc/kernel/sys_sunos.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc/kernel/sys_sunos.c	Sat Feb 21 21:40:49 2004
@@ -33,6 +33,7 @@
 #include <linux/errno.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 #include <net/sock.h>
 
@@ -564,8 +565,6 @@ asmlinkage int sunos_pathconf(char *path
 }
 
 /* SunOS mount system call emulation */
-extern asmlinkage int
-sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp);
 
 asmlinkage int sunos_select(int width, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
 {
@@ -621,11 +620,6 @@ struct sunos_nfs_mount_args {
 };
 
 
-extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen);
-extern asmlinkage int sys_socket(int family, int type, int protocol);
-extern asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen);
-
-
 /* Bind the socket on a local reserved port and connect it to the
  * remote server.  This on Linux/i386 is done by the mount program,
  * not by the kernel.
@@ -814,8 +808,6 @@ out:
 	return ret;
 }
 
-extern asmlinkage int sys_setsid(void);
-extern asmlinkage int sys_setpgid(pid_t, pid_t);
 
 asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 {
@@ -1050,15 +1042,6 @@ static inline int check_nonblock(int ret
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_read(unsigned int fd,char *buf,int count);
-extern asmlinkage ssize_t sys_write(unsigned int fd,char *buf,int count);
-extern asmlinkage int sys_recv(int fd, void * ubuf, int size, unsigned flags);
-extern asmlinkage int sys_send(int fd, void * buff, int len, unsigned flags);
-extern asmlinkage int sys_accept(int fd, struct sockaddr *sa, int *addrlen);
-extern asmlinkage int sys_readv(unsigned long fd, const struct iovec * vector, long count);
-extern asmlinkage int sys_writev(unsigned long fd, const struct iovec * vector, long count);
-
-
 asmlinkage int sunos_read(unsigned int fd,char *buf,int count)
 {
 	int ret;
@@ -1164,9 +1147,6 @@ sunos_sigaction(int sig, const struct ol
 }
 
 
-extern asmlinkage int sys_setsockopt(int fd, int level, int optname, char *optval, int optlen);
-extern asmlinkage int sys_getsockopt(int fd, int level, int optname, char *optval, int *optlen);
-
 asmlinkage int sunos_setsockopt(int fd, int level, int optname, char *optval,
 				int optlen)
 {
diff -puN arch/x86_64/ia32/ia32_ioctl.c~add-syscalls_h arch/x86_64/ia32/ia32_ioctl.c
--- 25-x86_64/arch/x86_64/ia32/ia32_ioctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/ia32/ia32_ioctl.c	Sat Feb 21 21:40:49 2004
@@ -10,12 +10,11 @@
  */
 
 #define INCLUDES
+#include <linux/syscalls.h>
 #include "compat_ioctl.c"
 #include <asm/mtrr.h>
 #include <asm/ia32.h>
 
-extern asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
 #define CODE
 #include "compat_ioctl.c"
   
diff -puN arch/x86_64/ia32/sys_ia32.c~add-syscalls_h arch/x86_64/ia32/sys_ia32.c
--- 25-x86_64/arch/x86_64/ia32/sys_ia32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/ia32/sys_ia32.c	Sat Feb 21 21:40:49 2004
@@ -26,6 +26,7 @@
 #include <linux/fs.h> 
 #include <linux/file.h> 
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/resource.h>
 #include <linux/times.h>
 #include <linux/utsname.h>
@@ -110,9 +111,6 @@ int cp_compat_stat(struct kstat *kbuf, s
 	return 0;
 }
 
-extern long sys_truncate(char *, loff_t);
-extern long sys_ftruncate(int, loff_t);
-
 asmlinkage long
 sys32_truncate64(char * filename, unsigned long offset_low, unsigned long offset_high)
 {
@@ -236,8 +234,6 @@ sys32_mmap(struct mmap_arg_struct *arg)
 	return retval;
 }
 
-extern asmlinkage long sys_mprotect(unsigned long start,size_t len,unsigned long prot);
-
 asmlinkage long 
 sys32_mprotect(unsigned long start, size_t len, unsigned long prot)
 {
@@ -363,12 +359,9 @@ sys32_sigaction (int sig, struct old_sig
 	return ret;
 }
 
-extern asmlinkage long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset,
-					  size_t sigsetsize);
-
 asmlinkage long
-sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset,
-		     unsigned int sigsetsize)
+sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
+			compat_sigset_t __user *oset, unsigned int sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -734,9 +727,6 @@ sys32_old_select(struct sel_arg_struct *
 			    (struct compat_timeval *)A(a.tvp));
 }
 
-asmlinkage ssize_t sys_readv(unsigned long,const struct iovec *,unsigned long);
-asmlinkage ssize_t sys_writev(unsigned long,const struct iovec *,unsigned long);
-
 static struct iovec *
 get_compat_iovec(struct compat_iovec *iov32, struct iovec *iov_buf, u32 *count, int type, int *errp)
 {
@@ -878,18 +868,12 @@ int sys32_ni_syscall(int call)
 
 /* 32-bit timeval and related flotsam.  */
 
-extern asmlinkage long sys_sysfs(int option, unsigned long arg1,
-				unsigned long arg2);
-
 asmlinkage long
 sys32_sysfs(int option, u32 arg1, u32 arg2)
 {
 	return sys_sysfs(option, arg1, arg2);
 }
 
-extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type,
-				unsigned long new_flags, void *data);
-
 static char *badfs[] = {
 	"smbfs", "ncpfs", NULL
 }; 	
@@ -940,8 +924,6 @@ struct sysinfo32 {
         char _f[20-2*sizeof(u32)-sizeof(int)];
 };
 
-extern asmlinkage long sys_sysinfo(struct sysinfo *info);
-
 asmlinkage long
 sys32_sysinfo(struct sysinfo32 *info)
 {
@@ -991,9 +973,6 @@ sys32_sysinfo(struct sysinfo32 *info)
 	return 0;
 }
                 
-extern asmlinkage long sys_sched_rr_get_interval(pid_t pid,
-						struct timespec *interval);
-
 asmlinkage long
 sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
 {
@@ -1009,10 +988,8 @@ sys32_sched_rr_get_interval(compat_pid_t
 	return ret;
 }
 
-extern asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-
 asmlinkage long
-sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
+sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1035,9 +1012,6 @@ sys32_rt_sigpending(compat_sigset_t *set
 	return ret;
 }
 
-extern asmlinkage long
-sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
-		    const struct timespec *uts, size_t sigsetsize);
 
 asmlinkage long
 sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
@@ -1077,9 +1051,6 @@ sys32_rt_sigtimedwait(compat_sigset_t *u
 	return ret;
 }
 
-extern asmlinkage long
-sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
-
 asmlinkage long
 sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 {
@@ -1165,12 +1136,6 @@ sys32_sysctl(struct sysctl_ia32 *args32)
 #endif
 }
 
-extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
-				    size_t count, loff_t pos);
-
-extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
-				     size_t count, loff_t pos);
-
 /* warning: next two assume little endian */ 
 asmlinkage long
 sys32_pread(unsigned int fd, char *ubuf, u32 count, u32 poslo, u32 poshi)
@@ -1187,8 +1152,6 @@ sys32_pwrite(unsigned int fd, char *ubuf
 }
 
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage long
 sys32_personality(unsigned long personality)
 {
@@ -1202,9 +1165,6 @@ sys32_personality(unsigned long personal
 	return ret;
 }
 
-extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset,
-				       size_t count); 
-
 asmlinkage long
 sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
 {
@@ -1375,9 +1335,7 @@ long sys32_uname(struct old_utsname * na
 	return err?-EFAULT:0;
 }
 
-extern int sys_ustat(dev_t, struct ustat *);
-
-long sys32_ustat(unsigned dev, struct ustat32 *u32p)
+long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
 {
 	struct ustat u;
 	mm_segment_t seg;
@@ -1500,15 +1458,11 @@ asmlinkage long sys32_clone(unsigned int
  * Some system calls that need sign extended arguments. This could be done by a generic wrapper.
  */ 
 
-extern off_t sys_lseek (unsigned int fd, off_t offset, unsigned int origin);
-
 long sys32_lseek (unsigned int fd, int offset, unsigned int whence)
 {
 	return sys_lseek(fd, offset, whence);
 }
 
-extern int sys_kill(pid_t pid, int sig); 
-
 long sys32_kill(int pid, int sig)
 {
 	return sys_kill(pid, sig);
@@ -1736,15 +1690,12 @@ done:
 	return err;
 }
 #else /* !NFSD */
-extern asmlinkage long sys_ni_syscall(void);
 long asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2)
 {
 	return sys_ni_syscall();
 }
 #endif
 
-extern long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx);
-
 long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p)
 { 
 	long ret; 
@@ -1802,11 +1753,6 @@ asmlinkage long sys32_io_submit(aio_cont
 	return i ? i : ret;
 }
 
-extern asmlinkage long sys_io_getevents(aio_context_t ctx_id,
-					  long min_nr,
-					  long nr,
-					  struct io_event *events,
-					  struct timespec *timeout);
 
 asmlinkage long sys32_io_getevents(aio_context_t ctx_id,
 				 unsigned long min_nr,
@@ -1895,8 +1841,6 @@ sys32_timer_create(u32 clock, struct sig
 	return err; 
 } 
 
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
-
 long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, 
 			__u32 len_low, __u32 len_high, int advice)
 { 
diff -puN arch/x86_64/kernel/x8664_ksyms.c~add-syscalls_h arch/x86_64/kernel/x8664_ksyms.c
--- 25-x86_64/arch/x86_64/kernel/x8664_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/kernel/x8664_ksyms.c	Sat Feb 21 21:40:49 2004
@@ -11,6 +11,7 @@
 #include <linux/apm_bios.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/syscalls.h>
 #include <linux/tty.h>
 
 #include <asm/semaphore.h>
@@ -180,8 +181,6 @@ EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(__memcpy);
 
 /* syscall export needed for misdesigned sound drivers. */
-extern ssize_t sys_read(unsigned int fd, char * buf, size_t count);
-extern off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin);
 EXPORT_SYMBOL(sys_read);
 EXPORT_SYMBOL(sys_lseek);
 EXPORT_SYMBOL(sys_open);
diff -puN drivers/macintosh/via-pmu.c~add-syscalls_h drivers/macintosh/via-pmu.c
--- 25-x86_64/drivers/macintosh/via-pmu.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/drivers/macintosh/via-pmu.c	Sat Feb 21 21:40:49 2004
@@ -44,6 +44,7 @@
 #include <linux/interrupt.h>
 #include <linux/device.h>
 #include <linux/suspend.h>
+#include <linux/syscalls.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
@@ -2292,8 +2293,6 @@ restore_via_state(void)
 	out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
 }
 
-extern long sys_sync(void);
-
 static int __pmac
 pmac_suspend_devices(void)
 {
diff -puN fs/compat.c~add-syscalls_h fs/compat.c
--- 25-x86_64/fs/compat.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/compat.c	Sat Feb 21 21:40:49 2004
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/sockios.h>	/* for SIOCDEVPRIVATE */
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/ctype.h>
 #include <linux/module.h>
 #include <net/sock.h>		/* siocdevprivate_ioctl */
@@ -494,8 +495,6 @@ static int put_compat_flock64(struct flo
 }
 #endif
 
-extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long);
-
 asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
 		unsigned long arg)
 {
@@ -559,8 +558,6 @@ asmlinkage long compat_sys_fcntl(unsigne
 	return compat_sys_fcntl64(fd, cmd, arg);
 }
 
-extern asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx);
-
 asmlinkage long
 compat_sys_io_setup(unsigned nr_reqs, u32 *ctx32p)
 {
@@ -580,12 +577,6 @@ compat_sys_io_setup(unsigned nr_reqs, u3
 	return ret;
 }
 
-extern asmlinkage long sys_io_getevents(aio_context_t ctx_id,
-					  long min_nr,
-					  long nr,
-					  struct io_event *events,
-					  struct timespec *timeout);
-
 asmlinkage long
 compat_sys_io_getevents(aio_context_t ctx_id,
 				 unsigned long min_nr,
@@ -614,9 +605,6 @@ out:
 	return ret;
 }
 
-extern asmlinkage long sys_io_submit(aio_context_t, long, 
-				struct iocb __user **);
-
 static inline long
 copy_iocb(long nr, u32 *ptr32, u64 *ptr64)
 {
diff -puN include/asm-alpha/unistd.h~add-syscalls_h include/asm-alpha/unistd.h
--- 25-x86_64/include/asm-alpha/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-alpha/unistd.h	Sat Feb 21 21:40:49 2004
@@ -548,15 +548,14 @@ type name (type1 arg1,type2 arg2,type3 a
 
 #include <linux/string.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <asm/ptrace.h>
 
-extern long sys_open(const char *, int, int);
 static inline long open(const char * name, int mode, int flags)
 {
 	return sys_open(name, mode, flags);
 }
 
-extern long sys_dup(int);
 static inline long dup(int fd)
 {
 	return sys_dup(fd);
@@ -564,17 +563,14 @@ static inline long dup(int fd)
 
 static inline long close(int fd)
 {
-	extern long sys_close(unsigned int);
 	return sys_close(fd);
 }
 
-extern off_t sys_lseek(int, off_t, int);
 static inline off_t lseek(int fd, off_t off, int whence)
 {
 	return sys_lseek(fd, off, whence);
 }
 
-extern long sys_exit(int);
 static inline long _exit(int value)
 {
 	return sys_exit(value);
@@ -582,13 +578,11 @@ static inline long _exit(int value)
 
 #define exit(x) _exit(x)
 
-extern long sys_write(int, const char *, size_t);
 static inline long write(int fd, const char * buf, size_t nr)
 {
 	return sys_write(fd, buf, nr);
 }
 
-extern long sys_read(int, char *, size_t);
 static inline long read(int fd, char * buf, size_t nr)
 {
 	return sys_read(fd, buf, nr);
@@ -596,19 +590,20 @@ static inline long read(int fd, char * b
 
 extern long execve(char *, char **, char **);
 
-extern long sys_setsid(void);
 static inline long setsid(void)
 {
 	return sys_setsid();
 }
 
-struct rusage;
-extern asmlinkage long sys_wait4(pid_t, unsigned int *, int, struct rusage *);
 static inline pid_t waitpid(int pid, int * wait_stat, int flags)
 {
 	return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
+asmlinkage int sys_execve(char *ufilename, char **argv, char **envp,
+			unsigned long a3, unsigned long a4, unsigned long a5,
+			struct pt_regs regs);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-arm26/unistd.h~add-syscalls_h include/asm-arm26/unistd.h
--- 25-x86_64/include/asm-arm26/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-arm26/unistd.h	Sat Feb 21 21:40:49 2004
@@ -377,8 +377,7 @@ type name(type1 arg1, type2 arg2, type3 
 
 #ifdef __KERNEL_SYSCALLS__
 
-struct rusage;
-asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
+#include <linux/syscalls.h>
 
 static inline long idle(void)
 {
@@ -388,61 +387,51 @@ static inline long idle(void)
 
 static inline long pause(void)
 {
-	extern long sys_pause(void);
 	return sys_pause();
 }
 
 static inline long sync(void)
 {
-	extern long sys_sync(void);
 	return sys_sync();
 }
 
 static inline pid_t setsid(void)
 {
-	extern long sys_setsid(void);
 	return sys_setsid();
 }
 
 static inline long write(int fd, const char *buf, off_t count)
 {
-	extern long sys_write(int, const char *, int);
 	return sys_write(fd, buf, count);
 }
 
 static inline long read(int fd, char *buf, off_t count)
 {
-	extern long sys_read(int, char *, int);
 	return sys_read(fd, buf, count);
 }
 
 static inline off_t lseek(int fd, off_t offset, int count)
 {
-	extern off_t sys_lseek(int, off_t, int);
 	return sys_lseek(fd, offset, count);
 }
 
 static inline long dup(int fd)
 {
-	extern long sys_dup(int);
 	return sys_dup(fd);
 }
 
 static inline long open(const char *file, int flag, int mode)
 {
-	extern long sys_open(const char *, int, int);
 	return sys_open(file, flag, mode);
 }
 
 static inline long close(int fd)
 {
-	extern long sys_close(unsigned int);
 	return sys_close(fd);
 }
 
 static inline long _exit(int exitcode)
 {
-	extern long sys_exit(int) __attribute__((noreturn));
 	return sys_exit(exitcode);
 }
 
@@ -453,8 +442,7 @@ static inline pid_t waitpid(pid_t pid, i
 
 static inline long delete_module(const char *name)
 {
-	extern long sys_delete_module(const char *name);
-	return sys_delete_module(name);
+	return sys_delete_module(name, 0);
 }
 
 static inline pid_t wait(int * wait_stat)
@@ -462,6 +450,16 @@ static inline pid_t wait(int * wait_stat
 	return sys_wait4(-1, wait_stat, 0, NULL);
 }
 
+struct pt_regs;
+asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
+			struct pt_regs *regs);
+asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
+			struct pt_regs *regs);
+asmlinkage int sys_fork(struct pt_regs *regs);
+asmlinkage int sys_vfork(struct pt_regs *regs);
+asmlinkage int sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+
 /*
  * The following two can't be eliminated yet - they rely on
  * specific conditions.
diff -puN include/asm-arm/unistd.h~add-syscalls_h include/asm-arm/unistd.h
--- 25-x86_64/include/asm-arm/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-arm/unistd.h	Sat Feb 21 21:40:49 2004
@@ -450,54 +450,45 @@ type name(type1 arg1, type2 arg2, type3 
 
 #ifdef __KERNEL_SYSCALLS__
 
-struct rusage;
-asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
+#include <linux/syscalls.h>
 
 static inline pid_t setsid(void)
 {
-	extern long sys_setsid(void);
 	return sys_setsid();
 }
 
 static inline long write(int fd, const char *buf, off_t count)
 {
-	extern long sys_write(int, const char *, int);
 	return sys_write(fd, buf, count);
 }
 
 static inline long read(int fd, char *buf, off_t count)
 {
-	extern long sys_read(int, char *, int);
 	return sys_read(fd, buf, count);
 }
 
 static inline off_t lseek(int fd, off_t offset, int count)
 {
-	extern off_t sys_lseek(int, off_t, int);
 	return sys_lseek(fd, offset, count);
 }
 
 static inline long dup(int fd)
 {
-	extern long sys_dup(int);
 	return sys_dup(fd);
 }
 
 static inline long open(const char *file, int flag, int mode)
 {
-	extern long sys_open(const char *, int, int);
 	return sys_open(file, flag, mode);
 }
 
 static inline long close(int fd)
 {
-	extern long sys_close(unsigned int);
 	return sys_close(fd);
 }
 
 static inline long _exit(int exitcode)
 {
-	extern long sys_exit(int) __attribute__((noreturn));
 	return sys_exit(exitcode);
 }
 
@@ -506,6 +497,16 @@ static inline pid_t waitpid(pid_t pid, i
 	return sys_wait4((int)pid, wait_stat, options, NULL);
 }
 
+struct pt_regs;
+asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
+			struct pt_regs *regs);
+asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
+			struct pt_regs *regs);
+asmlinkage int sys_fork(struct pt_regs *regs);
+asmlinkage int sys_vfork(struct pt_regs *regs);
+asmlinkage int sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+
 /*
  * The following two can't be eliminated yet - they rely on
  * specific conditions.
diff -puN include/asm-i386/unistd.h~add-syscalls_h include/asm-i386/unistd.h
--- 25-x86_64/include/asm-i386/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-i386/unistd.h	Sat Feb 21 21:40:49 2004
@@ -373,6 +373,8 @@ __syscall_return(type,__res); \
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <asm/ptrace.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -395,6 +397,18 @@ static inline _syscall3(int,open,const c
 static inline _syscall1(int,close,int,fd)
 static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
+asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount);
+asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(struct pt_regs regs);
+asmlinkage int sys_clone(struct pt_regs regs);
+asmlinkage int sys_fork(struct pt_regs regs);
+asmlinkage int sys_vfork(struct pt_regs regs);
+asmlinkage int sys_pipe(unsigned long __user *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_iopl(unsigned long unused);
+
 #endif
 
 /*
diff -puN include/asm-ia64/unistd.h~add-syscalls_h include/asm-ia64/unistd.h
--- 25-x86_64/include/asm-ia64/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-ia64/unistd.h	Sat Feb 21 21:40:49 2004
@@ -255,6 +255,9 @@
 
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
 
+#include <linux/types.h>
+#include <linux/linkage.h>
+
 extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
 
 #ifdef __KERNEL_SYSCALLS__
@@ -263,39 +266,35 @@ extern long __ia64_syscall (long a0, lon
 #include <linux/signal.h>
 #include <asm/ptrace.h>
 #include <linux/stringify.h>
+#include <linux/syscalls.h>
 
 static inline long
 open (const char * name, int mode, int flags)
 {
-	extern long sys_open (const char *, int, int);
 	return sys_open(name, mode, flags);
 }
 
 static inline long
 dup (int fd)
 {
-	extern long sys_dup (int);
 	return sys_dup(fd);
 }
 
 static inline long
 close (int fd)
 {
-	extern long sys_close(unsigned int);
 	return sys_close(fd);
 }
 
 static inline off_t
 lseek (int fd, off_t off, int whence)
 {
-	extern off_t sys_lseek (int, off_t, int);
 	return sys_lseek(fd, off, whence);
 }
 
 static inline long
 _exit (int value)
 {
-	extern long sys_exit (int);
 	return sys_exit(value);
 }
 
@@ -304,14 +303,12 @@ _exit (int value)
 static inline long
 write (int fd, const char * buf, size_t nr)
 {
-	extern long sys_write (int, const char *, size_t);
 	return sys_write(fd, buf, nr);
 }
 
 static inline long
 read (int fd, char * buf, size_t nr)
 {
-	extern long sys_read (int, char *, size_t);
 	return sys_read(fd, buf, nr);
 }
 
@@ -319,17 +316,12 @@ read (int fd, char * buf, size_t nr)
 static inline long
 setsid (void)
 {
-	extern long sys_setsid (void);
 	return sys_setsid();
 }
 
-struct rusage;
-
 static inline pid_t
 waitpid (int pid, int * wait_stat, int flags)
 {
-	extern asmlinkage long sys_wait4 (pid_t, unsigned int *, int, struct rusage *);
-
 	return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
@@ -339,6 +331,23 @@ extern pid_t clone (unsigned long flags,
 
 #endif /* __KERNEL_SYSCALLS__ */
 
+asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				int prot, int flags,
+				int fd, long off);
+asmlinkage unsigned long sys_mmap2(
+				unsigned long addr, unsigned long len,
+				int prot, int flags,
+				int fd, long pgoff);
+struct pt_regs;
+asmlinkage long sys_execve(char *filename, char **argv, char **envp,
+				struct pt_regs *regs);
+asmlinkage long sys_pipe(long arg0, long arg1, long arg2, long arg3,
+			long arg4, long arg5, long arg6, long arg7, long stack);
+asmlinkage long sys_ptrace(long request, pid_t pid,
+			unsigned long addr, unsigned long data,
+			long arg4, long arg5, long arg6, long arg7, long stack);
+
 /*
  * "Conditional" syscalls
  *
diff -puN include/asm-mips/unistd.h~add-syscalls_h include/asm-mips/unistd.h
--- 25-x86_64/include/asm-mips/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-mips/unistd.h	Sat Feb 21 21:40:49 2004
@@ -1047,6 +1047,9 @@ type name (atype a,btype b,ctype c,dtype
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <asm/ptrace.h>
+#include <asm/sim.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -1075,6 +1078,18 @@ static inline pid_t waitpid(int pid, int
 	return wait4(pid, wait_stat, flags, NULL);
 }
 
+asmlinkage unsigned long sys_mmap(
+				unsigned long addr, size_t len,
+				int prot, int flags,
+				int fd, off_t offset);
+asmlinkage long sys_mmap2(
+			unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs);
+asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+
 #endif /* __KERNEL_SYSCALLS__ */
 #endif /* !__ASSEMBLY__ */
 
diff -puN include/asm-parisc/unistd.h~add-syscalls_h include/asm-parisc/unistd.h
--- 25-x86_64/include/asm-parisc/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-parisc/unistd.h	Sat Feb 21 21:40:49 2004
@@ -840,34 +840,30 @@ type name(type1 arg1, type2 arg2, type3 
 #ifdef __KERNEL_SYSCALLS__
 
 #include <asm/current.h>
+#include <linux/syscalls.h>
 
 static inline pid_t setsid(void)
 {
-	extern long sys_setsid(void);
 	return sys_setsid();
 }
 
 static inline int write(int fd, const char *buf, off_t count)
 {
-	extern long sys_write(int, const char *, int);
 	return sys_write(fd, buf, count);
 }
 
 static inline int read(int fd, char *buf, off_t count)
 {
-	extern long sys_read(int, char *, int);
 	return sys_read(fd, buf, count);
 }
 
 static inline off_t lseek(int fd, off_t offset, int count)
 {
-	extern off_t sys_lseek(int, off_t, int);
 	return sys_lseek(fd, offset, count);
 }
 
 static inline int dup(int fd)
 {
-	extern long sys_dup(int);
 	return sys_dup(fd);
 }
 
@@ -880,30 +876,39 @@ static inline int execve(char *filename,
 
 static inline int open(const char *file, int flag, int mode)
 {
-	extern long sys_open(const char *, int, int);
 	return sys_open(file, flag, mode);
 }
 
 static inline int close(int fd)
 {
-	extern asmlinkage long sys_close(unsigned int);
 	return sys_close(fd);
 }
 
 static inline int _exit(int exitcode)
 {
-	extern long sys_exit(int) __attribute__((noreturn));
 	return sys_exit(exitcode);
 }
 
-struct rusage;
-extern asmlinkage long sys_wait4(pid_t, unsigned int *, int, struct rusage *);
-
 static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
 {
 	return sys_wait4(pid, wait_stat, options, NULL);
 }
 
+asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long offset);
+asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long pgoff);
+struct pt_regs;
+asmlinkage int sys_execve(struct pt_regs *regs);
+int sys_clone(unsigned long clone_flags, unsigned long usp,
+		struct pt_regs *regs);
+int sys_vfork(struct pt_regs *regs);
+int sys_pipe(int *fildes);
+long sys_ptrace(long request, pid_t pid, long addr, long data);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on);
+
 #endif	/* __KERNEL_SYSCALLS__ */
 
 #endif /* __ASSEMBLY__ */
diff -puN include/asm-ppc64/unistd.h~add-syscalls_h include/asm-ppc64/unistd.h
--- 25-x86_64/include/asm-ppc64/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-ppc64/unistd.h	Sat Feb 21 21:40:49 2004
@@ -274,6 +274,9 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/types.h>
+#include <linux/linkage.h>
+
 /* On powerpc a system call basically clobbers the same registers like a
  * function call, with the exception of LR (which is needed for the
  * "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal
@@ -404,9 +407,27 @@ extern int execve(const char *file, char
 extern int open(const char *file, int flag, int mode);
 extern int close(int fd);
 extern pid_t waitpid(pid_t pid, int *wait_stat, int options);
-
 #endif /* __KERNEL_SYSCALLS__ */
 
+asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, off_t offset);
+struct pt_regs;
+int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
+		unsigned long a3, unsigned long a4, unsigned long a5,
+		struct pt_regs *regs);
+int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3,
+		unsigned long p4, unsigned long p5, unsigned long p6,
+		struct pt_regs *regs);
+int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
+		unsigned long p4, unsigned long p5, unsigned long p6,
+		struct pt_regs *regs);
+int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
+		unsigned long p4, unsigned long p5, unsigned long p6,
+		struct pt_regs *regs);
+asmlinkage int sys_pipe(int *fildes);
+int sys_ptrace(long request, long pid, long addr, long data);
+
 /*
  * "Conditional" syscalls
  *
diff -puN include/asm-ppc/unistd.h~add-syscalls_h include/asm-ppc/unistd.h
--- 25-x86_64/include/asm-ppc/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-ppc/unistd.h	Sat Feb 21 21:40:49 2004
@@ -390,6 +390,27 @@ extern int open(const char *file, int fl
 extern int close(int fd);
 extern pid_t waitpid(pid_t pid, int *wait_stat, int options);
 
+unsigned long sys_mmap(unsigned long addr, size_t len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, off_t offset);
+unsigned long sys_mmap2(unsigned long addr, size_t len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+struct pt_regs;
+int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
+		unsigned long a3, unsigned long a4, unsigned long a5,
+		struct pt_regs *regs);
+int sys_clone(unsigned long clone_flags, unsigned long usp,
+	      int __user *parent_tidp, void __user *child_threadptr,
+	      int __user *child_tidp, int p6,
+	      struct pt_regs *regs);
+int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
+		struct pt_regs *regs);
+int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6,
+		struct pt_regs *regs);
+int sys_pipe(int __user *fildes);
+int sys_ptrace(long request, long pid, long addr, long data);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-s390/unistd.h~add-syscalls_h include/asm-s390/unistd.h
--- 25-x86_64/include/asm-s390/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-s390/unistd.h	Sat Feb 21 21:40:49 2004
@@ -505,7 +505,10 @@ type name(type1 arg1, type2 arg2, type3 
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <linux/config.h>
+#include <asm/ptrace.h>
 #include <asm/stat.h>
+#include <linux/syscalls.h>
 
 /*
  * we need this inline - forking from kernel space will result
@@ -531,12 +534,25 @@ static inline _syscall1(int,close,int,fd
 static inline _syscall1(int,_exit,int,exitcode)
 static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
 
-struct rusage;
-extern long sys_wait4(pid_t, unsigned int *, int, struct rusage *);
 static inline pid_t waitpid(int pid, int *wait_stat, int flags)
 {
 	return sys_wait4(pid, wait_stat, flags, NULL);
 }
+struct mmap_arg_struct;
+asmlinkage long sys_mmap2(struct mmap_arg_struct *arg);
+
+asmlinkage int sys_execve(struct pt_regs regs);
+asmlinkage int sys_clone(struct pt_regs regs);
+asmlinkage int sys_fork(struct pt_regs regs);
+asmlinkage int sys_vfork(struct pt_regs regs);
+#ifndef CONFIG_ARCH_S390X
+#define __SYS_RETTYPE int
+#else
+#define __SYS_RETTYPE long
+#endif /* CONFIG_ARCH_S390X */
+asmlinkage __SYS_RETTYPE sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
 
 #endif
 
diff -puN include/asm-sparc64/unistd.h~add-syscalls_h include/asm-sparc64/unistd.h
--- 25-x86_64/include/asm-sparc64/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-sparc64/unistd.h	Sat Feb 21 21:40:49 2004
@@ -440,6 +440,12 @@ static __inline__ _syscall1(int,close,in
 static __inline__ _syscall1(int,_exit,int,exitcode)
 static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
+asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long off);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 #ifdef __KERNEL__
diff -puN include/asm-sparc/unistd.h~add-syscalls_h include/asm-sparc/unistd.h
--- 25-x86_64/include/asm-sparc/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-sparc/unistd.h	Sat Feb 21 21:40:49 2004
@@ -450,6 +450,16 @@ static __inline__ _syscall1(int,close,in
 static __inline__ _syscall1(int,_exit,int,exitcode)
 static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
+asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long off);
+asmlinkage unsigned long sys_mmap2(
+				unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-um/unistd.h~add-syscalls_h include/asm-um/unistd.h
--- 25-x86_64/include/asm-um/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-um/unistd.h	Sat Feb 21 21:40:49 2004
@@ -6,24 +6,11 @@
 #ifndef _UM_UNISTD_H_
 #define _UM_UNISTD_H_
 
+#include <linux/syscalls.h>
 #include "linux/resource.h"
 #include "asm/uaccess.h"
 
-extern long sys_open(const char *filename, int flags, int mode);
-extern long sys_dup(unsigned int fildes);
-extern long sys_close(unsigned int fd);
 extern int um_execve(const char *file, char *const argv[], char *const env[]);
-extern long sys_setsid(void);
-extern long sys_waitpid(pid_t pid, unsigned int * stat_addr, int options);
-extern long sys_wait4(pid_t pid,unsigned int *stat_addr, int options, 
-		      struct rusage *ru);
-extern long sys_mount(char *dev_name, char *dir_name, char *type, 
-		      unsigned long flags, void *data);
-extern long sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, 
-		       struct timeval *tvp);
-extern long sys_lseek(unsigned int fildes, unsigned long offset, int whence);
-extern long sys_read(unsigned int fildes, char *buf, int len);
-extern long sys_write(int fildes, const char *buf, size_t len);
 
 #ifdef __KERNEL_SYSCALLS__
 
@@ -81,6 +68,17 @@ static inline int write(unsigned int fd,
 	KERNEL_CALL(int, sys_write, fd, buf, len)
 }
 
+long sys_mmap2(unsigned long addr, unsigned long len,
+		unsigned long prot, unsigned long flags,
+		unsigned long fd, unsigned long pgoff);
+int sys_execve(char *file, char **argv, char **env);
+long sys_clone(unsigned long clone_flags, unsigned long newsp,
+		int *parent_tid, int *child_tid);
+long sys_fork(void);
+long sys_vfork(void);
+int sys_pipe(unsigned long *fildes);
+int sys_ptrace(long request, long pid, long addr, long data);
+
 #endif
 
 /* Save the value of __KERNEL_SYSCALLS__, undefine it, include the underlying
diff -puN include/asm-v850/unistd.h~add-syscalls_h include/asm-v850/unistd.h
--- 25-x86_64/include/asm-v850/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-v850/unistd.h	Sat Feb 21 21:40:49 2004
@@ -417,6 +417,17 @@ extern inline pid_t wait(int * wait_stat
 	return waitpid (-1, wait_stat, 0);
 }
 
+unsigned long sys_mmap(unsigned long addr, size_t len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, off_t offset);
+unsigned long sys_mmap2(unsigned long addr, size_t len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+struct pt_regs;
+int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs);
+int sys_pipe (int *fildes);
+int sys_ptrace(long request, long pid, long addr, long data);
+
 #endif
 
 /*
diff -puN include/asm-x86_64/unistd.h~add-syscalls_h include/asm-x86_64/unistd.h
--- 25-x86_64/include/asm-x86_64/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-x86_64/unistd.h	Sat Feb 21 21:40:49 2004
@@ -636,6 +636,9 @@ __syscall_return(type,__res); \
 
 #else /* __KERNEL_SYSCALLS__ */
 
+#include <linux/syscalls.h>
+#include <asm/ptrace.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -650,31 +653,26 @@ __syscall_return(type,__res); \
  */
 #define __NR__exit __NR_exit
 
-extern pid_t sys_setsid(void);
 static inline pid_t setsid(void)
 {
 	return sys_setsid();
 }
 
-long sys_write(int fd, const char *buf, size_t size);
 static inline ssize_t write(unsigned int fd, char * buf, size_t count)
 {
 	return sys_write(fd, buf, count);
 }
 
-extern ssize_t sys_read(unsigned int, char *, size_t);
 static inline ssize_t read(unsigned int fd, char * buf, size_t count)
 {
 	return sys_read(fd, buf, count);
 }
 
-extern off_t sys_lseek(unsigned int, off_t, unsigned int);
 static inline off_t lseek(unsigned int fd, off_t offset, unsigned int origin)
 {
 	return sys_lseek(fd, offset, origin);
 }
 
-extern long sys_dup(unsigned int);
 static inline long dup(unsigned int fd)
 {
 	return sys_dup(fd);
@@ -683,34 +681,50 @@ static inline long dup(unsigned int fd)
 /* implemented in asm in arch/x86_64/kernel/entry.S */
 extern long execve(char *, char **, char **);
 
-extern long sys_open(const char *, int, int);
 static inline long open(const char * filename, int flags, int mode)
 {
 	return sys_open(filename, flags, mode);
 }
 
-extern long sys_close(unsigned int);
 static inline long close(unsigned int fd)
 {
 	return sys_close(fd);
 }
 
-extern long sys_exit(int) __attribute__((noreturn));
-extern inline void exit(int error_code)
-{
-	sys_exit(error_code);
-}
-
-struct rusage; 
-long sys_wait4(pid_t pid,unsigned int * stat_addr, 
-			int options, struct rusage * ru);
 static inline pid_t waitpid(int pid, int * wait_stat, int flags)
 {
 	return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
+extern long sys_mmap(unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long off);
+
+extern int sys_modify_ldt(int func, void *ptr, unsigned long bytecount);
+
+asmlinkage long sys_execve(char *name, char **argv, char **envp,
+			struct pt_regs regs);
+asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
+			void *parent_tid, void *child_tid,
+			struct pt_regs regs);
+asmlinkage long sys_fork(struct pt_regs regs);
+asmlinkage long sys_vfork(struct pt_regs regs);
+asmlinkage long sys_pipe(int *fildes);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
+#ifndef __ASSEMBLY__
+
+#include <linux/linkage.h>
+#include <asm/ptrace.h>
+
+asmlinkage long sys_ptrace(long request, long pid,
+				unsigned long addr, long data);
+asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on);
+
+#endif	/* __ASSEMBLY__ */
+
 #endif /* __NO_STUBS */
 
 /*
diff -puN /dev/null include/linux/syscalls.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-x86_64-akpm/include/linux/syscalls.h	Sat Feb 21 21:40:49 2004
@@ -0,0 +1,480 @@
+/*
+ * syscalls.h - Linux syscall interfaces (non-arch-specific)
+ *
+ * Copyright (c) 2004 Randy Dunlap
+ * Copyright (c) 2004 Open Source Development Labs
+ *
+ * This file is released under the GPLv2.
+ * See the file COPYING for more details.
+ */
+
+#ifndef _LINUX_SYSCALLS_H
+#define _LINUX_SYSCALLS_H
+
+struct epoll_event;
+struct iattr;
+struct inode;
+struct iocb;
+struct io_event;
+struct iovec;
+struct itimerspec;
+struct itimerval;
+struct linux_dirent;
+struct linux_dirent64;
+struct list_head;
+struct msgbuf;
+struct msghdr;
+struct msqid_ds;
+struct new_utsname;
+struct nfsctl_arg;
+struct __old_kernel_stat;
+struct pollfd;
+struct rlimit;
+struct rusage;
+struct sched_param;
+struct semaphore;
+struct sembuf;
+struct shmid_ds;
+struct sockaddr;
+struct stat;
+struct stat64;
+struct statfs;
+struct statfs64;
+struct __sysctl_args;
+struct sysinfo;
+struct timespec;
+struct timeval;
+struct timex;
+struct timezone;
+struct tms;
+struct utimbuf;
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/aio_abi.h>
+#include <linux/capability.h>
+#include <linux/list.h>
+#include <linux/sem.h>
+#include <asm/semaphore.h>
+#include <asm/siginfo.h>
+#include <asm/signal.h>
+#include <linux/quota.h>
+
+asmlinkage long sys_time(int *tloc);
+asmlinkage long sys_stime(time_t *tptr);
+asmlinkage long sys_gettimeofday(struct timeval __user *tv,
+				struct timezone __user *tz);
+asmlinkage long sys_settimeofday(struct timeval __user *tv,
+				struct timezone __user *tz);
+asmlinkage long sys_adjtimex(struct timex __user *txc_p);
+
+asmlinkage long sys_times(struct tms __user *tbuf);
+
+asmlinkage long sys_gettid(void);
+asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp);
+asmlinkage unsigned long sys_alarm(unsigned int seconds);
+asmlinkage long sys_getpid(void);
+asmlinkage long sys_getppid(void);
+asmlinkage long sys_getuid(void);
+asmlinkage long sys_geteuid(void);
+asmlinkage long sys_getgid(void);
+asmlinkage long sys_getegid(void);
+asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
+asmlinkage long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
+asmlinkage long sys_getpgid(pid_t pid);
+asmlinkage long sys_getpgrp(void);
+asmlinkage long sys_getsid(pid_t pid);
+asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist);
+
+asmlinkage long sys_setregid(gid_t rgid, gid_t egid);
+asmlinkage long sys_setgid(gid_t gid);
+asmlinkage long sys_setreuid(uid_t ruid, uid_t euid);
+asmlinkage long sys_setuid(uid_t uid);
+asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid);
+asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+asmlinkage long sys_setfsuid(uid_t uid);
+asmlinkage long sys_setfsgid(gid_t gid);
+asmlinkage long sys_setpgid(pid_t pid, pid_t pgid);
+asmlinkage long sys_setsid(void);
+asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist);
+
+asmlinkage long sys_acct(const char *name);
+asmlinkage long sys_capget(cap_user_header_t header,
+				cap_user_data_t dataptr);
+asmlinkage long sys_capset(cap_user_header_t header,
+				const cap_user_data_t data);
+asmlinkage long sys_personality(u_long personality);
+
+asmlinkage long sys_sigpending(old_sigset_t __user *set);
+asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
+				old_sigset_t __user *oset);
+asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
+asmlinkage long sys_setitimer(int which,
+				struct itimerval __user *value,
+				struct itimerval __user *ovalue);
+asmlinkage long sys_timer_gettime(timer_t timer_id,
+				struct itimerspec __user *setting);
+asmlinkage long sys_timer_getoverrun(timer_t timer_id);
+asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
+				const struct itimerspec __user *new_setting,
+				struct itimerspec __user *old_setting);
+asmlinkage long sys_timer_delete(timer_t timer_id);
+asmlinkage long sys_clock_settime(clockid_t which_clock,
+				const struct timespec __user *tp);
+asmlinkage long sys_clock_gettime(clockid_t which_clock,
+				struct timespec __user *tp);
+asmlinkage long sys_clock_getres(clockid_t which_clock,
+				struct timespec __user *tp);
+asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
+				const struct timespec __user *rqtp,
+				struct timespec __user *rmtp);
+
+asmlinkage long sys_nice(int increment);
+asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
+					struct sched_param __user *param);
+asmlinkage long sys_sched_setparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long sys_sched_getscheduler(pid_t pid);
+asmlinkage long sys_sched_getparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
+					unsigned long __user *user_mask_ptr);
+asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
+					unsigned long __user *user_mask_ptr);
+asmlinkage long sys_sched_yield(void);
+asmlinkage long sys_sched_get_priority_max(int policy);
+asmlinkage long sys_sched_get_priority_min(int policy);
+asmlinkage long sys_sched_rr_get_interval(pid_t pid,
+					struct timespec __user *interval);
+asmlinkage long sys_setpriority(int which, int who, int niceval);
+asmlinkage long sys_getpriority(int which, int who);
+
+asmlinkage long sys_shutdown(int, int);
+asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd,
+				void __user *arg);
+asmlinkage long sys_restart_syscall(void);
+
+asmlinkage long sys_exit(int error_code);
+asmlinkage void sys_exit_group(int error_code);
+asmlinkage long sys_wait4(pid_t pid, unsigned int *stat_addr,
+				int options, struct rusage *ru);
+asmlinkage long sys_waitpid(pid_t pid, unsigned int *stat_addr, int options);
+asmlinkage long sys_set_tid_address(int __user *tidptr);
+asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
+			struct timespec __user *utime, u32 __user *uaddr2);
+
+asmlinkage long sys_init_module(void __user *umod, unsigned long len,
+				const char __user *uargs);
+asmlinkage long sys_delete_module(const char __user *name_user,
+				unsigned int flags);
+
+asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set,
+				sigset_t __user *oset, size_t sigsetsize);
+asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize);
+asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
+				siginfo_t __user *uinfo,
+				const struct timespec __user *uts,
+				size_t sigsetsize);
+asmlinkage long sys_kill(int pid, int sig);
+asmlinkage long sys_tgkill(int tgid, int pid, int sig);
+asmlinkage long sys_tkill(int pid, int sig);
+asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo);
+asmlinkage long sys_rt_sigaction(int sig,
+				const struct sigaction __user *act,
+				struct sigaction __user *oact,
+				size_t sigsetsize);
+asmlinkage long sys_sgetmask(void);
+asmlinkage long sys_ssetmask(int newmask);
+asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler);
+asmlinkage long sys_pause(void);
+
+asmlinkage long sys_sync(void);
+asmlinkage long sys_fsync(unsigned int fd);
+asmlinkage long sys_fdatasync(unsigned int fd);
+asmlinkage long sys_bdflush(int func, long data);
+asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name,
+				char __user *type, unsigned long flags,
+				void __user *data);
+asmlinkage long sys_umount(char __user *name, int flags);
+asmlinkage long sys_oldumount(char __user *name);
+asmlinkage long sys_truncate(const char __user *path,
+				unsigned long length);
+asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
+asmlinkage long sys_stat(char __user *filename,
+			struct __old_kernel_stat __user *statbuf);
+asmlinkage long sys_statfs(const char __user * path,
+				struct statfs __user *buf);
+asmlinkage long sys_statfs64(const char __user *path, size_t sz,
+				struct statfs64 __user *buf);
+asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf);
+asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz,
+				struct statfs64 __user *buf);
+asmlinkage long sys_lstat(char __user *filename,
+			struct __old_kernel_stat __user *statbuf);
+asmlinkage long sys_fstat(unsigned int fd,
+			struct __old_kernel_stat __user *statbuf);
+asmlinkage long sys_newstat(char __user *filename,
+				struct stat __user *statbuf);
+asmlinkage long sys_newlstat(char __user *filename,
+				struct stat __user *statbuf);
+asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf);
+asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
+#if BITS_PER_LONG == 32
+asmlinkage long sys_stat64(char __user *filename,
+				struct stat64 __user *statbuf);
+asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
+asmlinkage long sys_lstat64(char __user *filename,
+				struct stat64 __user *statbuf);
+asmlinkage long sys_truncate64(const char __user *path, loff_t length);
+asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
+#endif
+
+asmlinkage long sys_setxattr(char __user *path, char __user *name,
+				void __user *value, size_t size, int flags);
+asmlinkage long sys_lsetxattr(char __user *path, char __user *name,
+				void __user *value, size_t size, int flags);
+asmlinkage long sys_fsetxattr(int fd, char __user *name, void __user *value,
+				size_t size, int flags);
+asmlinkage ssize_t sys_getxattr(char __user *path, char __user *name,
+				void __user *value, size_t size);
+asmlinkage ssize_t sys_lgetxattr(char __user *path, char __user *name,
+				void __user *value, size_t size);
+asmlinkage ssize_t sys_fgetxattr(int fd, char __user *name,
+				void __user *value, size_t size);
+asmlinkage ssize_t sys_listxattr(char __user *path, char __user *list,
+				size_t size);
+asmlinkage ssize_t sys_llistxattr(char __user *path, char __user *list,
+				size_t size);
+asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long sys_removexattr(char __user *path, char __user *name);
+asmlinkage long sys_lremovexattr(char __user *path, char __user *name);
+asmlinkage long sys_fremovexattr(int fd, char __user *name);
+
+asmlinkage unsigned long sys_brk(unsigned long brk);
+asmlinkage long sys_mprotect(unsigned long start, size_t len,
+				unsigned long prot);
+asmlinkage unsigned long sys_mremap(unsigned long addr,
+				unsigned long old_len, unsigned long new_len,
+				unsigned long flags, unsigned long new_addr);
+long sys_remap_file_pages(unsigned long start, unsigned long size,
+			unsigned long prot, unsigned long pgoff,
+			unsigned long flags);
+asmlinkage long sys_msync(unsigned long start, size_t len, int flags);
+asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice);
+asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
+asmlinkage long sys_munmap(unsigned long addr, size_t len);
+asmlinkage long sys_mlock(unsigned long start, size_t len);
+asmlinkage long sys_munlock(unsigned long start, size_t len);
+asmlinkage long sys_mlockall(int flags);
+asmlinkage long sys_munlockall(void);
+asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
+asmlinkage long sys_mincore(unsigned long start, size_t len,
+				unsigned char __user * vec);
+
+asmlinkage long sys_pivot_root(const char __user *new_root,
+				const char __user *put_old);
+asmlinkage long sys_chroot(const char __user *filename);
+asmlinkage long sys_mknod(const char __user *filename, int mode,
+				unsigned dev);
+asmlinkage long sys_link(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long sys_symlink(const char *old, const char *new);
+asmlinkage long sys_unlink(const char __user *pathname);
+asmlinkage long sys_rename(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long sys_chmod(const char __user *filename, mode_t mode);
+asmlinkage long sys_fchmod(unsigned int fd, mode_t mode);
+
+asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
+#if BITS_PER_LONG == 32
+asmlinkage long sys_fcntl64(unsigned int fd,
+				unsigned int cmd, unsigned long arg);
+#endif
+asmlinkage long sys_dup(unsigned int fildes);
+asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
+asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd,
+				unsigned long arg);
+asmlinkage long sys_flock(unsigned int fd, unsigned int cmd);
+asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx);
+asmlinkage long sys_io_destroy(aio_context_t ctx);
+asmlinkage long sys_io_getevents(aio_context_t ctx_id,
+				long min_nr,
+				long nr,
+				struct io_event *events,
+				struct timespec *timeout);
+asmlinkage long sys_io_submit(aio_context_t, long,
+				struct iocb __user **);
+asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb,
+			      struct io_event *result);
+asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd,
+				off_t __user *offset, size_t count);
+asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd,
+				loff_t __user *offset, size_t count);
+asmlinkage long sys_readlink(const char __user *path,
+				char __user *buf, int bufsiz);
+asmlinkage long sys_creat(const char __user *pathname, int mode);
+asmlinkage long sys_open(const char __user *filename,
+				int flags, int mode);
+asmlinkage long sys_close(unsigned int fd);
+asmlinkage long sys_access(const char __user *filename, int mode);
+asmlinkage long sys_vhangup(void);
+asmlinkage long sys_chown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long sys_lchown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);
+#ifdef CONFIG_UID16
+asmlinkage long sys_chown16(const char *filename,
+				old_uid_t user, old_gid_t group);
+asmlinkage long sys_lchown16(const char *filename,
+				old_uid_t user, old_gid_t group);
+asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group);
+asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid);
+asmlinkage long sys_setgid16(old_gid_t gid);
+asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid);
+asmlinkage long sys_setuid16(old_uid_t uid);
+asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid);
+asmlinkage long sys_getresuid16(old_uid_t *ruid,
+				old_uid_t *euid, old_uid_t *suid);
+asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid);
+asmlinkage long sys_getresgid16(old_gid_t *rgid,
+				old_gid_t *egid, old_gid_t *sgid);
+asmlinkage long sys_setfsuid16(old_uid_t uid);
+asmlinkage long sys_setfsgid16(old_gid_t gid);
+asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist);
+asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist);
+asmlinkage long sys_getuid16(void);
+asmlinkage long sys_geteuid16(void);
+asmlinkage long sys_getgid16(void);
+asmlinkage long sys_getegid16(void);
+#endif
+
+asmlinkage long sys_utime(char __user *filename,
+				struct utimbuf __user *times);
+asmlinkage long sys_utimes(char __user *filename,
+				struct timeval __user *utimes);
+asmlinkage off_t sys_lseek(unsigned int fd, off_t offset,
+				unsigned int origin);
+asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
+			unsigned long offset_low, loff_t __user *result,
+			unsigned int origin);
+asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf,
+				size_t count);
+asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
+asmlinkage ssize_t sys_readv(unsigned long fd,
+				const struct iovec __user *vec,
+				unsigned long vlen);
+asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf,
+				size_t count);
+asmlinkage ssize_t sys_writev(unsigned long fd,
+				const struct iovec __user *vec,
+				unsigned long vlen);
+asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
+				size_t count, loff_t pos);
+asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf,
+				size_t count, loff_t pos);
+asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
+asmlinkage long sys_mkdir(const char __user *pathname, int mode);
+asmlinkage long sys_chdir(const char __user *filename);
+asmlinkage long sys_fchdir(unsigned int fd);
+asmlinkage long sys_rmdir(const char __user *pathname);
+asmlinkage long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len);
+asmlinkage long sys_quotactl(unsigned int cmd, const char *special,
+				qid_t id, caddr_t addr);
+asmlinkage long sys_getdents(unsigned int fd,
+				struct linux_dirent __user *dirent,
+				unsigned int count);
+asmlinkage long sys_getdents64(unsigned int fd,
+				struct linux_dirent64 __user *dirent,
+				unsigned int count);
+
+asmlinkage long sys_setsockopt(int fd, int level, int optname,
+				char *optval, int optlen);
+asmlinkage long sys_getsockopt(int fd, int level, int optname,
+				char __user *optval, int __user *optlen);
+asmlinkage long sys_bind(int, struct sockaddr *, int);
+asmlinkage long sys_connect(int, struct sockaddr *, int);
+asmlinkage long sys_accept(int, struct sockaddr *, int *);
+asmlinkage long sys_getsockname(int, struct sockaddr *, int *);
+asmlinkage long sys_getpeername(int, struct sockaddr *, int *);
+asmlinkage long sys_send(int, void *, size_t, unsigned);
+asmlinkage long sys_sendto(int, void *, size_t, unsigned,
+				struct sockaddr *, int);
+asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags);
+asmlinkage long sys_recv(int, void *, size_t, unsigned);
+asmlinkage long sys_recvfrom(int, void *, size_t, unsigned,
+				struct sockaddr *, int *);
+asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags);
+asmlinkage long sys_socket(int, int, int);
+asmlinkage long sys_socketpair(int, int, int, int [2]);
+asmlinkage long sys_socketcall(int call, unsigned long __user *args);
+asmlinkage long sys_listen(int, int);
+asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
+				long timeout);
+asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
+			fd_set __user *exp, struct timeval __user *tvp);
+asmlinkage long sys_epoll_create(int size);
+asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
+				struct epoll_event __user *event);
+asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
+				int maxevents, int timeout);
+asmlinkage long sys_gethostname(char __user *name, int len);
+asmlinkage long sys_sethostname(char __user *name, int len);
+asmlinkage long sys_setdomainname(char __user *name, int len);
+asmlinkage long sys_newuname(struct new_utsname __user *name);
+
+asmlinkage long sys_getrlimit(unsigned int resource,
+				struct rlimit __user *rlim);
+#if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64) || defined(CONFIG_V850))
+asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim);
+#endif
+asmlinkage long sys_setrlimit(unsigned int resource,
+				struct rlimit __user *rlim);
+asmlinkage long sys_getrusage(int who, struct rusage __user *ru);
+asmlinkage long sys_umask(int mask);
+
+asmlinkage long sys_msgget(key_t key, int msgflg);
+asmlinkage long sys_msgsnd(int msqid, struct msgbuf __user *msgp,
+				size_t msgsz, int msgflg);
+asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp,
+				size_t msgsz, long msgtyp, int msgflg);
+asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
+
+asmlinkage long sys_semget(key_t key, int nsems, int semflg);
+asmlinkage long sys_semop(int semid, struct sembuf __user *sops,
+				unsigned nsops);
+asmlinkage long sys_semctl(int semid, int semnum, int cmd, union semun arg);
+asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
+				unsigned nsops,
+				const struct timespec __user *timeout);
+asmlinkage long sys_shmat(int shmid, char __user *shmaddr,
+				int shmflg, unsigned long *addr);
+asmlinkage long sys_shmget(key_t key, size_t size, int flag);
+asmlinkage long sys_shmdt(char __user *shmaddr);
+asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
+
+asmlinkage long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn);
+asmlinkage long sys_pciconfig_read(unsigned long bus, unsigned long dfn,
+				unsigned long off, unsigned long len,
+				void *buf);
+asmlinkage long sys_pciconfig_write(unsigned long bus, unsigned long dfn,
+				unsigned long off, unsigned long len,
+				void *buf);
+
+asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+			unsigned long arg4, unsigned long arg5);
+asmlinkage long sys_swapon(const char __user *specialfile, int swap_flags);
+asmlinkage long sys_swapoff(const char __user *specialfile);
+asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
+asmlinkage long sys_sysinfo(struct sysinfo __user *info);
+asmlinkage long sys_sysfs(int option,
+				unsigned long arg1, unsigned long arg2);
+asmlinkage long sys_nfsservctl(int cmd,
+				struct nfsctl_arg __user *arg,
+				void __user *res);
+asmlinkage long sys_syslog(int type, char __user *buf, int len);
+asmlinkage long sys_uselib(const char __user *library);
+asmlinkage long sys_ni_syscall(void);
+
+#endif
diff -puN include/linux/sysctl.h~add-syscalls_h include/linux/sysctl.h
--- 25-x86_64/include/linux/sysctl.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/sysctl.h	Sat Feb 21 21:40:49 2004
@@ -727,7 +727,6 @@ enum
 
 #ifdef __KERNEL__
 
-extern asmlinkage long sys_sysctl(struct __sysctl_args __user *);
 extern void sysctl_init(void);
 
 typedef struct ctl_table ctl_table;
diff -puN init/do_mounts_devfs.c~add-syscalls_h init/do_mounts_devfs.c
--- 25-x86_64/init/do_mounts_devfs.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/init/do_mounts_devfs.c	Sat Feb 21 21:40:49 2004
@@ -2,14 +2,10 @@
 #include <linux/kernel.h>
 #include <linux/dirent.h>
 #include <linux/string.h>
+#include <linux/syscalls.h>
 
 #include "do_mounts.h"
 
-extern asmlinkage long sys_symlink(const char *old, const char *new);
-extern asmlinkage long sys_access(const char * filename, int mode);
-extern asmlinkage long sys_getdents64(unsigned int fd, void * dirent,
-				      unsigned int count);
-
 void __init mount_devfs(void)
 {
 	sys_mount("devfs", "/dev", "devfs", 0, NULL);
@@ -31,7 +27,8 @@ static int __init do_read_dir(int fd, vo
 	lseek(fd, 0, 0);
 
 	for (bytes = 0; bytes < len; bytes += n) {
-		n = sys_getdents64(fd, p + bytes, len - bytes);
+		n = sys_getdents64(fd, (struct linux_dirent64 *)(p + bytes),
+					len - bytes);
 		if (n < 0)
 			return n;
 		if (n == 0)
diff -puN init/do_mounts.h~add-syscalls_h init/do_mounts.h
--- 25-x86_64/init/do_mounts.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/init/do_mounts.h	Sat Feb 21 21:40:49 2004
@@ -3,25 +3,13 @@
 #include <linux/kernel.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/init.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/slab.h>
 #include <linux/mount.h>
 #include <linux/major.h>
 #include <linux/root_dev.h>
 
-asmlinkage long sys_unlink(const char *name);
-asmlinkage long sys_mknod(const char *name, int mode, unsigned dev);
-asmlinkage long sys_newstat(char * filename, struct stat * statbuf);
-asmlinkage long sys_ioctl(int fd, int cmd, unsigned long arg);
-asmlinkage long sys_mkdir(const char *name, int mode);
-asmlinkage long sys_rmdir(const char *name);
-asmlinkage long sys_chdir(const char *name);
-asmlinkage long sys_fchdir(int fd);
-asmlinkage long sys_chroot(const char *name);
-asmlinkage long sys_mount(char *dev_name, char *dir_name, char *type,
-				 unsigned long flags, void *data);
-asmlinkage long sys_umount(char *name, int flags);
-
 dev_t name_to_dev_t(char *name);
 void  change_floppy(char *fmt, ...);
 void  mount_block_root(char *name, int flags);
@@ -49,7 +37,6 @@ static inline int create_dev(char *name,
 #endif
 
 #if BITS_PER_LONG == 32
-asmlinkage long sys_stat64(char *name, struct stat64 *stat);
 static inline u32 bstat(char *name)
 {
 	struct stat64 stat;
diff -puN init/initramfs.c~add-syscalls_h init/initramfs.c
--- 25-x86_64/init/initramfs.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/init/initramfs.c	Sat Feb 21 21:40:49 2004
@@ -7,6 +7,7 @@
 #include <linux/unistd.h>
 #include <linux/delay.h>
 #include <linux/string.h>
+#include <linux/syscalls.h>
 
 static __initdata char *message;
 static void __init error(char *x)
@@ -25,17 +26,6 @@ static void __init free(void *where)
 	kfree(where);
 }
 
-asmlinkage long sys_mkdir(char *name, int mode);
-asmlinkage long sys_mknod(char *name, int mode, unsigned dev);
-asmlinkage long sys_symlink(char *old, char *new);
-asmlinkage long sys_link(char *old, char *new);
-asmlinkage long sys_write(int fd, const char *buf, size_t size);
-asmlinkage long sys_chown(char *name, uid_t uid, gid_t gid);
-asmlinkage long sys_lchown(char *name, uid_t uid, gid_t gid);
-asmlinkage long sys_fchown(int fd, uid_t uid, gid_t gid);
-asmlinkage long sys_chmod(char *name, mode_t mode);
-asmlinkage long sys_fchmod(int fd, mode_t mode);
-
 /* link hash */
 
 static struct hash {
diff -puN kernel/compat.c~add-syscalls_h kernel/compat.c
--- 25-x86_64/kernel/compat.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/compat.c	Sat Feb 21 21:40:49 2004
@@ -18,6 +18,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>	/* for MAX_SCHEDULE_TIMEOUT */
 #include <linux/futex.h>	/* for FUTEX_WAIT */
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 
 #include <asm/uaccess.h>
@@ -172,8 +173,6 @@ asmlinkage long compat_sys_times(struct 
  * types that can be passed to put_user()/get_user().
  */
 
-extern asmlinkage long sys_sigpending(old_sigset_t *);
-
 asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
 {
 	old_sigset_t s;
@@ -188,8 +187,6 @@ asmlinkage long compat_sys_sigpending(co
 	return ret;
 }
 
-extern asmlinkage long sys_sigprocmask(int, old_sigset_t *, old_sigset_t *);
-
 asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
 		compat_old_sigset_t *oset)
 {
@@ -230,8 +227,6 @@ asmlinkage long compat_sys_futex(u32 *ua
 }
 #endif
 
-asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim);
-
 asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit *rlim)
 {
 	struct rlimit r;
@@ -257,7 +252,6 @@ asmlinkage long compat_sys_setrlimit(uns
 }
 
 #ifdef COMPAT_RLIM_OLD_INFINITY
-asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit *rlim);
 
 asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rlimit *rlim)
 {
@@ -282,9 +276,8 @@ asmlinkage long compat_sys_old_getrlimit
 	}
 	return ret;
 }
-#endif
 
-asmlinkage long sys_getrlimit (unsigned int resource, struct rlimit *rlim);
+#endif
 
 asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimit *rlim)
 {
@@ -334,8 +327,6 @@ static long put_compat_rusage (struct co
 	return 0;
 }
 
-asmlinkage long sys_getrusage(int who, struct rusage *ru);
-
 asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
 {
 	struct rusage r;
@@ -381,9 +372,6 @@ compat_sys_wait4(compat_pid_t pid, compa
 	}
 }
 
-extern asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
-					    unsigned long *user_mask_ptr);
-
 asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, 
 					     unsigned int len,
 					     compat_ulong_t *user_mask_ptr)
@@ -405,9 +393,6 @@ asmlinkage long compat_sys_sched_setaffi
 	return ret;
 }
 
-extern asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
-					    unsigned long *user_mask_ptr);
-
 asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
 					    compat_ulong_t *user_mask_ptr)
 {
@@ -449,12 +434,6 @@ static int put_compat_itimerspec(struct 
 	return 0;
 } 
 
-extern asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
-				  struct itimerspec __user *new_setting,
-				 struct itimerspec __user *old_setting);
-extern asmlinkage long sys_timer_gettime(timer_t timer_id, 
-					 struct itimerspec __user *setting);
-
 long compat_timer_settime(timer_t timer_id, int flags, 
 			  struct compat_itimerspec *new, 
 			  struct compat_itimerspec *old)
@@ -487,9 +466,6 @@ long compat_timer_gettime(timer_t timer_
 	return err;
 } 
 
-extern asmlinkage long
-sys_clock_settime(clockid_t which_clock, struct timespec __user *tp);
-
 long compat_clock_settime(clockid_t which_clock,  struct compat_timespec *tp)
 {
 	long err;
@@ -504,9 +480,6 @@ long compat_clock_settime(clockid_t whic
 	return err;
 } 
 
-extern asmlinkage long
-sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp);
-
 long compat_clock_gettime(clockid_t which_clock,  struct compat_timespec *tp)
 {
 	long err;
@@ -521,9 +494,6 @@ long compat_clock_gettime(clockid_t whic
 	return err;
 } 
 
-extern asmlinkage long
-sys_clock_getres(clockid_t which_clock, struct timespec __user *tp);
-
 long compat_clock_getres(clockid_t which_clock,  struct compat_timespec *tp)
 {
 	long err;
@@ -538,11 +508,6 @@ long compat_clock_getres(clockid_t which
 	return err;
 } 
 
-extern asmlinkage long
-sys_clock_nanosleep(clockid_t which_clock, int flags,
-		     struct timespec __user *rqtp,
-		    struct timespec __user *rmtp);
-
 long compat_clock_nanosleep(clockid_t which_clock, int flags,
 			    struct compat_timespec __user *rqtp,
 			    struct compat_timespec __user *rmtp)
diff -puN kernel/panic.c~add-syscalls_h kernel/panic.c
--- 25-x86_64/kernel/panic.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/panic.c	Sat Feb 21 21:40:49 2004
@@ -16,11 +16,10 @@
 #include <linux/notifier.h>
 #include <linux/init.h>
 #include <linux/sysrq.h>
+#include <linux/syscalls.h>
 #include <linux/interrupt.h>
 #include <linux/nmi.h>
 
-asmlinkage void sys_sync(void);	/* it's really int */
-
 int panic_timeout;
 int panic_on_oops;
 int tainted;
diff -puN kernel/power/disk.c~add-syscalls_h kernel/power/disk.c
--- 25-x86_64/kernel/power/disk.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/power/disk.c	Sat Feb 21 21:40:49 2004
@@ -12,6 +12,7 @@
 
 
 #include <linux/suspend.h>
+#include <linux/syscalls.h>
 #include <linux/reboot.h>
 #include <linux/string.h>
 #include <linux/delay.h>
@@ -28,8 +29,6 @@ extern int pmdisk_read(void);
 extern int pmdisk_restore(void);
 extern int pmdisk_free(void);
 
-extern long sys_sync(void);
-
 
 /**
  *	power_down - Shut machine down for hibernate.
diff -puN kernel/power/swsusp.c~add-syscalls_h kernel/power/swsusp.c
--- 25-x86_64/kernel/power/swsusp.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/power/swsusp.c	Sat Feb 21 21:40:49 2004
@@ -59,6 +59,7 @@
 #include <linux/buffer_head.h>
 #include <linux/swapops.h>
 #include <linux/bootmem.h>
+#include <linux/syscalls.h>
 #include <linux/console.h>
 
 #include <asm/uaccess.h>
@@ -68,8 +69,6 @@
 
 #include "power.h"
 
-extern long sys_sync(void);
-
 unsigned char software_suspend_enabled = 0;
 
 extern void do_magic(int resume);
diff -puN kernel/sysctl.c~add-syscalls_h kernel/sysctl.c
--- 25-x86_64/kernel/sysctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/sysctl.c	Sat Feb 21 21:40:49 2004
@@ -2044,7 +2044,7 @@ int sysctl_jiffies(ctl_table *table, int
 #else /* CONFIG_SYSCTL */
 
 
-extern asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
+asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
 {
 	return -ENOSYS;
 }
diff -puN kernel/uid16.c~add-syscalls_h kernel/uid16.c
--- 25-x86_64/kernel/uid16.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/uid16.c	Sat Feb 21 21:40:49 2004
@@ -13,21 +13,10 @@
 #include <linux/init.h>
 #include <linux/highuid.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 
 #include <asm/uaccess.h>
 
-extern asmlinkage long sys_chown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_lchown(const char *, uid_t,gid_t);
-extern asmlinkage long sys_fchown(unsigned int, uid_t,gid_t);
-extern asmlinkage long sys_setregid(gid_t, gid_t);
-extern asmlinkage long sys_setgid(gid_t);
-extern asmlinkage long sys_setreuid(uid_t, uid_t);
-extern asmlinkage long sys_setuid(uid_t);
-extern asmlinkage long sys_setresuid(uid_t, uid_t, uid_t);
-extern asmlinkage long sys_setresgid(gid_t, gid_t, gid_t);
-extern asmlinkage long sys_setfsuid(uid_t);
-extern asmlinkage long sys_setfsgid(gid_t);
- 
 asmlinkage long sys_chown16(const char * filename, old_uid_t user, old_gid_t group)
 {
 	return sys_chown(filename, low2highuid(user), low2highgid(group));
diff -puN net/compat.c~add-syscalls_h net/compat.c
--- 25-x86_64/net/compat.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/net/compat.c	Sat Feb 21 21:40:49 2004
@@ -18,6 +18,7 @@
 #include <linux/file.h>
 #include <linux/icmpv6.h>
 #include <linux/socket.h>
+#include <linux/syscalls.h>
 #include <linux/filter.h>
 #include <linux/compat.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
@@ -304,9 +305,6 @@ void scm_detach_fds_compat(struct msghdr
 	__scm_destroy(scm);
 }
 
-extern asmlinkage long sys_setsockopt(int fd, int level, int optname,
-				     char *optval, int optlen);
-
 /*
  * For now, we assume that the compatibility and native version
  * of struct ipt_entry are the same - sfr.  FIXME
@@ -471,9 +469,6 @@ asmlinkage long compat_sys_setsockopt(in
 	return sys_setsockopt(fd, level, optname, optval, optlen);
 }
 
-extern asmlinkage long sys_getsockopt(int fd, int level, int optname,
-				       void * optval, int *optlen);
-
 static int do_get_sock_timeout(int fd, int level, int optname, char *optval,
 		int *optlen)
 {
@@ -517,22 +512,6 @@ static unsigned char nas[18]={AL(0),AL(3
 				AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)};
 #undef AL
 
-extern asmlinkage long sys_bind(int, struct sockaddr *, int);
-extern asmlinkage long sys_connect(int, struct sockaddr *, int);
-extern asmlinkage long sys_accept(int, struct sockaddr *, int *); 
-extern asmlinkage long sys_getsockname(int, struct sockaddr *, int *);
-extern asmlinkage long sys_getpeername(int, struct sockaddr *, int *);
-extern asmlinkage long sys_send(int, void *, size_t, unsigned);
-extern asmlinkage long sys_sendto(int, void *, size_t, unsigned,
-		struct sockaddr *, int);
-extern asmlinkage long sys_recv(int, void *, size_t, unsigned);
-extern asmlinkage long sys_recvfrom(int, void *, size_t, unsigned,
-		struct sockaddr *, int *);
-extern asmlinkage long sys_socket(int, int, int);
-extern asmlinkage long sys_socketpair(int, int, int, int [2]);
-extern asmlinkage long sys_shutdown(int, int);
-extern asmlinkage long sys_listen(int, int);
-
 asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr *msg, unsigned flags)
 {
 	return sys_sendmsg(fd, (struct msghdr *)msg, flags | MSG_CMSG_COMPAT);
diff -puN arch/arm26/kernel/armksyms.c~add-syscalls_h arch/arm26/kernel/armksyms.c
--- 25-x86_64/arch/arm26/kernel/armksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/arm26/kernel/armksyms.c	Sat Feb 21 21:40:49 2004
@@ -21,6 +21,7 @@
 #include <linux/tty.h>
 #include <linux/vt_kern.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 #include <asm/byteorder.h>
 #include <asm/elf.h>
@@ -43,14 +44,6 @@ extern void outswb(unsigned int port, co
 extern void __bad_xchg(volatile void *ptr, int size);
 
 /*
- * syscalls
- */
-extern int sys_write(int, const char *, int);
-extern int sys_read(int, char *, int);
-extern int sys_lseek(int, off_t, int);
-extern int sys_exit(int);
-
-/*
  * libgcc functions - functions that are used internally by the
  * compiler...  (prototypes are not correct though, but that
  * doesn't really matter since they're not versioned).
diff -puN arch/arm/kernel/armksyms.c~add-syscalls_h arch/arm/kernel/armksyms.c
--- 25-x86_64/arch/arm/kernel/armksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/arm/kernel/armksyms.c	Sat Feb 21 21:40:49 2004
@@ -22,6 +22,7 @@
 #include <linux/tty.h>
 #include <linux/vt_kern.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 
 #include <asm/byteorder.h>
 #include <asm/elf.h>
@@ -44,14 +45,6 @@ extern void outswb(unsigned int port, co
 extern void __bad_xchg(volatile void *ptr, int size);
 
 /*
- * syscalls
- */
-extern int sys_write(int, const char *, int);
-extern int sys_read(int, char *, int);
-extern int sys_lseek(int, off_t, int);
-extern int sys_exit(int);
-
-/*
  * libgcc functions - functions that are used internally by the
  * compiler...  (prototypes are not correct though, but that
  * doesn't really matter since they're not versioned).
diff -puN arch/ia64/ia32/ia32_signal.c~add-syscalls_h arch/ia64/ia32/ia32_signal.c
--- 25-x86_64/arch/ia64/ia32/ia32_signal.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ia64/ia32/ia32_signal.c	Sat Feb 21 21:40:49 2004
@@ -20,6 +20,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/stddef.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/wait.h>
 #include <linux/compat.h>
@@ -550,9 +551,6 @@ sys32_rt_sigaction (int sig, struct siga
 }
 
 
-extern asmlinkage long sys_rt_sigprocmask (int how, sigset_t *set, sigset_t *oset,
-					   size_t sigsetsize);
-
 asmlinkage long
 sys32_rt_sigprocmask (int how, compat_sigset_t *set, compat_sigset_t *oset, unsigned int sigsetsize)
 {
@@ -584,8 +582,6 @@ asmlinkage long
 sys32_rt_sigtimedwait (compat_sigset_t *uthese, siginfo_t32 *uinfo,
 		struct compat_timespec *uts, unsigned int sigsetsize)
 {
-	extern asmlinkage long sys_rt_sigtimedwait (const sigset_t *, siginfo_t *,
-						    const struct timespec *, size_t);
 	extern int copy_siginfo_to_user32 (siginfo_t32 *, siginfo_t *);
 	mm_segment_t old_fs = get_fs();
 	struct timespec t;
@@ -611,7 +607,6 @@ sys32_rt_sigtimedwait (compat_sigset_t *
 asmlinkage long
 sys32_rt_sigqueueinfo (int pid, int sig, siginfo_t32 *uinfo)
 {
-	extern asmlinkage long sys_rt_sigqueueinfo (int, int, siginfo_t *);
 	extern int copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 *from);
 	mm_segment_t old_fs = get_fs();
 	siginfo_t info;
diff -puN arch/ia64/kernel/sys_ia64.c~add-syscalls_h arch/ia64/kernel/sys_ia64.c
--- 25-x86_64/arch/ia64/kernel/sys_ia64.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ia64/kernel/sys_ia64.c	Sat Feb 21 21:40:49 2004
@@ -15,6 +15,7 @@
 #include <linux/file.h>		/* doh, must come after sched.h... */
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/highuid.h>
 #include <linux/hugetlb.h>
 
@@ -74,7 +75,6 @@ arch_get_unmapped_area (struct file *fil
 asmlinkage long
 ia64_getpriority (int which, int who)
 {
-	extern long sys_getpriority (int, int);
 	long prio;
 
 	prio = sys_getpriority(which, who);
diff -puN arch/mips/kernel/signal32.c~add-syscalls_h arch/mips/kernel/signal32.c
--- 25-x86_64/arch/mips/kernel/signal32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/mips/kernel/signal32.c	Sat Feb 21 21:40:49 2004
@@ -13,6 +13,7 @@
 #include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
@@ -764,9 +765,6 @@ out:
 	return ret;
 }
 
-asmlinkage long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset,
-				   size_t sigsetsize);
-
 asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set,
 	compat_sigset_t *oset, unsigned int sigsetsize)
 {
@@ -788,8 +786,6 @@ asmlinkage int sys32_rt_sigprocmask(int 
 	return ret;
 }
 
-asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-
 asmlinkage int sys32_rt_sigpending(compat_sigset_t *uset,
 	unsigned int sigsetsize)
 {
@@ -898,8 +894,6 @@ asmlinkage int sys32_rt_sigtimedwait(com
 	return ret;
 }
 
-extern asmlinkage int sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
-
 asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 {
 	siginfo_t info;
diff -puN arch/parisc/kernel/signal32.c~add-syscalls_h arch/parisc/kernel/signal32.c
--- 25-x86_64/arch/parisc/kernel/signal32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/parisc/kernel/signal32.c	Sat Feb 21 21:40:49 2004
@@ -28,6 +28,7 @@
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 
@@ -92,9 +93,6 @@ get_sigset32(compat_sigset_t *up, sigset
 int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset,
 				    unsigned int sigsetsize)
 {
-	extern long sys_rt_sigprocmask(int how,
-				    sigset_t *set, sigset_t *oset,
-				   size_t sigsetsize);
 	sigset_t old_set, new_set;
 	int ret;
 
@@ -115,7 +113,6 @@ int sys32_rt_sigpending(compat_sigset_t 
 {
 	int ret;
 	sigset_t set;
-	extern long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
 
 	KERNEL_SYSCALL(ret, sys_rt_sigpending, &set, sigsetsize);
 
diff -puN arch/ppc64/kernel/rtasd.c~add-syscalls_h arch/ppc64/kernel/rtasd.c
diff -puN arch/arm26/kernel/sys_arm.c~add-syscalls_h arch/arm26/kernel/sys_arm.c
--- 25-x86_64/arch/arm26/kernel/sys_arm.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/arm26/kernel/sys_arm.c	Sat Feb 21 21:40:52 2004
@@ -21,6 +21,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -138,7 +139,6 @@ out:
  * Perform the select(nd, in, out, ex, tv) and mmap() system
  * calls.
  */
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 
 struct sel_arg_struct {
 	unsigned long n;
diff -puN arch/arm/kernel/sys_arm.c~add-syscalls_h arch/arm/kernel/sys_arm.c
--- 25-x86_64/arch/arm/kernel/sys_arm.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/arm/kernel/sys_arm.c	Sat Feb 21 21:40:52 2004
@@ -20,6 +20,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -137,7 +138,6 @@ out:
  * Perform the select(nd, in, out, ex, tv) and mmap() system
  * calls.
  */
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 
 struct sel_arg_struct {
 	unsigned long n;
diff -puN arch/h8300/kernel/sys_h8300.c~add-syscalls_h arch/h8300/kernel/sys_h8300.c
--- 25-x86_64/arch/h8300/kernel/sys_h8300.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/h8300/kernel/sys_h8300.c	Sat Feb 21 21:40:52 2004
@@ -15,6 +15,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -155,8 +156,6 @@ out:
 }
 #endif
 
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-
 struct sel_arg_struct {
 	unsigned long n;
 	fd_set *inp, *outp, *exp;
@@ -261,7 +260,7 @@ asmlinkage int sys_ipc (uint call, int f
 	return -EINVAL;
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on)
 {
   return -ENOSYS;
 }
diff -puN arch/i386/kernel/sys_i386.c~add-syscalls_h arch/i386/kernel/sys_i386.c
--- 25-x86_64/arch/i386/kernel/sys_i386.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/i386/kernel/sys_i386.c	Sat Feb 21 21:40:52 2004
@@ -15,6 +15,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -106,8 +107,6 @@ out:
 }
 
 
-extern asmlinkage int sys_select(int, fd_set __user *, fd_set __user *, fd_set __user *, struct timeval __user *);
-
 struct sel_arg_struct {
 	unsigned long n;
 	fd_set __user *inp, *outp, *exp;
diff -puN arch/m68k/kernel/sys_m68k.c~add-syscalls_h arch/m68k/kernel/sys_m68k.c
--- 25-x86_64/arch/m68k/kernel/sys_m68k.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/kernel/sys_m68k.c	Sat Feb 21 21:40:52 2004
@@ -15,6 +15,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -156,8 +157,6 @@ out:
 }
 #endif
 
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-
 struct sel_arg_struct {
 	unsigned long n;
 	fd_set *inp, *outp, *exp;
@@ -262,7 +261,7 @@ asmlinkage int sys_ipc (uint call, int f
 	return -EINVAL;
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on)
 {
   return -ENOSYS;
 }
diff -puN arch/m68knommu/kernel/sys_m68k.c~add-syscalls_h arch/m68knommu/kernel/sys_m68k.c
--- 25-x86_64/arch/m68knommu/kernel/sys_m68k.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68knommu/kernel/sys_m68k.c	Sat Feb 21 21:40:52 2004
@@ -15,6 +15,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -111,8 +112,6 @@ out:
 	return error;
 }
 
-extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-
 struct sel_arg_struct {
 	unsigned long n;
 	fd_set *inp, *outp, *exp;
@@ -194,7 +193,7 @@ asmlinkage int sys_ipc (uint call, int f
 	return -EINVAL;
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on)
 {
   return -ENOSYS;
 }
diff -puN arch/parisc/kernel/parisc_ksyms.c~add-syscalls_h arch/parisc/kernel/parisc_ksyms.c
--- 25-x86_64/arch/parisc/kernel/parisc_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/parisc/kernel/parisc_ksyms.c	Sat Feb 21 21:40:52 2004
@@ -27,6 +27,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/syscalls.h>
 
 #include <linux/string.h>
 EXPORT_SYMBOL(memchr);
@@ -83,10 +84,6 @@ EXPORT_SYMBOL(__memcpy_fromio);
 EXPORT_SYMBOL(__memset_io);
 
 #include <asm/unistd.h>
-extern long sys_open(const char *, int, int);
-extern off_t sys_lseek(int, off_t, int);
-extern int sys_read(int, char *, int);
-extern int sys_write(int, const char *, int);
 EXPORT_SYMBOL(sys_open);
 EXPORT_SYMBOL(sys_lseek);
 EXPORT_SYMBOL(sys_read);
diff -puN arch/ppc/kernel/syscalls.c~add-syscalls_h arch/ppc/kernel/syscalls.c
--- 25-x86_64/arch/ppc/kernel/syscalls.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ppc/kernel/syscalls.c	Sat Feb 21 21:40:52 2004
@@ -29,6 +29,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/sys.h>
 #include <linux/ipc.h>
@@ -200,8 +201,6 @@ out:
 	return err;
 }
 
-extern int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-
 /*
  * Due to some executables calling the wrong select we sometimes
  * get wrong args.  This determines how the args are being passed
diff -puN arch/sh/kernel/sys_sh.c~add-syscalls_h arch/sh/kernel/sys_sh.c
--- 25-x86_64/arch/sh/kernel/sys_sh.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sh/kernel/sys_sh.c	Sat Feb 21 21:40:52 2004
@@ -17,6 +17,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
@@ -240,16 +241,12 @@ asmlinkage int sys_uname(struct old_utsn
 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char * buf,
 			     size_t count, long dummy, loff_t pos)
 {
-	extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
-					size_t count, loff_t pos);
 	return sys_pread64(fd, buf, count, pos);
 }
 
 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char * buf,
 			      size_t count, long dummy, loff_t pos)
 {
-	extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
-					size_t count, loff_t pos);
 	return sys_pwrite64(fd, buf, count, pos);
 }
 
diff -puN arch/sparc64/kernel/setup.c~add-syscalls_h arch/sparc64/kernel/setup.c
--- 25-x86_64/arch/sparc64/kernel/setup.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/setup.c	Sat Feb 21 21:40:52 2004
@@ -21,6 +21,7 @@
 #include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
+#include <linux/syscalls.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
 #include <linux/string.h>
@@ -71,7 +72,6 @@ struct screen_info screen_info = {
 
 void (*prom_palette)(int);
 void (*prom_keyboard)(void);
-asmlinkage void sys_sync(void);	/* it's really int */
 
 static void
 prom_console_write(struct console *con, const char *s, unsigned n)
@@ -603,7 +603,7 @@ static int __init set_preferred_console(
 }
 console_initcall(set_preferred_console);
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on)
 {
 	return -EIO;
 }
diff -puN arch/sparc/kernel/setup.c~add-syscalls_h arch/sparc/kernel/setup.c
--- 25-x86_64/arch/sparc/kernel/setup.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc/kernel/setup.c	Sat Feb 21 21:40:52 2004
@@ -22,6 +22,7 @@
 #include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
+#include <linux/syscalls.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
 #include <linux/string.h>
@@ -66,7 +67,6 @@ struct screen_info screen_info = {
 
 extern unsigned long trapbase;
 void (*prom_palette)(int);
-asmlinkage void sys_sync(void);	/* it's really int */
 
 /* Pretty sick eh? */
 void prom_sync_me(void)
diff -puN arch/s390/kernel/compat_wrapper.S~add-syscalls_h arch/s390/kernel/compat_wrapper.S
--- 25-x86_64/arch/s390/kernel/compat_wrapper.S~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/s390/kernel/compat_wrapper.S	Sat Feb 21 21:40:52 2004
@@ -567,13 +567,15 @@ compat_sys_sigprocmask_wrapper:
 
 	.globl  sys32_init_module_wrapper 
 sys32_init_module_wrapper:
-	llgtr	%r2,%r2			# const char *
-	llgtr	%r3,%r3			# struct module *
+	llgtr	%r2,%r2			# void *
+	llgfr	%r3,%r3			# unsigned long
+	llgtr	%r4,%r4			# char *
 	jg	sys32_init_module	# branch to system call
 
 	.globl  sys32_delete_module_wrapper 
 sys32_delete_module_wrapper:
 	llgtr	%r2,%r2			# const char *
+	llgfr	%r3,%r3			# unsigned int
 	jg	sys32_delete_module	# branch to system call
 
 	.globl  sys32_quotactl_wrapper 
diff -puN include/asm-x86_64/proto.h~add-syscalls_h include/asm-x86_64/proto.h
--- 25-x86_64/include/asm-x86_64/proto.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-x86_64/proto.h	Sat Feb 21 21:40:52 2004
@@ -24,7 +24,6 @@ extern void ia32_cstar_target(void); 
 
 extern void calibrate_delay(void);
 extern void cpu_idle(void);
-extern void sys_ni_syscall(void);
 extern void config_acpi_tables(void);
 extern void ia32_syscall(void);
 extern void iommu_hole_init(void);
diff -puN arch/h8300/kernel/signal.c~add-syscalls_h arch/h8300/kernel/signal.c
--- 25-x86_64/arch/h8300/kernel/signal.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/h8300/kernel/signal.c	Sat Feb 21 21:40:52 2004
@@ -28,6 +28,7 @@
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
@@ -46,8 +47,6 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-asmlinkage long sys_wait4(pid_t pid, unsigned int * stat_addr, int options,
-			struct rusage * ru);
 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
 
 /*
diff -puN arch/m68k/kernel/signal.c~add-syscalls_h arch/m68k/kernel/signal.c
--- 25-x86_64/arch/m68k/kernel/signal.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/kernel/signal.c	Sat Feb 21 21:40:52 2004
@@ -32,6 +32,7 @@
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
diff -puN arch/m68knommu/kernel/signal.c~add-syscalls_h arch/m68knommu/kernel/signal.c
--- 25-x86_64/arch/m68knommu/kernel/signal.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68knommu/kernel/signal.c	Sat Feb 21 21:40:52 2004
@@ -32,6 +32,7 @@
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
@@ -50,8 +51,6 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-asmlinkage long sys_wait4(pid_t pid, unsigned int * stat_addr, int options,
-			struct rusage * ru);
 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
 
 /*
diff -puN arch/sparc/kernel/sys_sparc.c~add-syscalls_h arch/sparc/kernel/sys_sparc.c
--- 25-x86_64/arch/sparc/kernel/sys_sparc.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc/kernel/sys_sparc.c	Sat Feb 21 21:40:52 2004
@@ -16,6 +16,7 @@
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/stat.h>
+#include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/utsname.h>
 #include <linux/smp.h>
@@ -78,8 +79,6 @@ unsigned long arch_get_unmapped_area(str
 	}
 }
 
-extern asmlinkage unsigned long sys_brk(unsigned long brk);
-
 asmlinkage unsigned long sparc_brk(unsigned long brk)
 {
 	if(ARCH_SUN4C_SUN4) {
diff -puN arch/um/include/kern_util.h~add-syscalls_h arch/um/include/kern_util.h
--- 25-x86_64/arch/um/include/kern_util.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/um/include/kern_util.h	Sat Feb 21 21:40:52 2004
@@ -45,7 +45,6 @@ extern int page_mask(void);
 extern int need_finish_fork(void);
 extern void free_stack(unsigned long stack, int order);
 extern void add_input_request(int op, void (*proc)(int), void *arg);
-extern int sys_execve(char *file, char **argv, char **env);
 extern char *current_cmd(void);
 extern void timer_handler(int sig, union uml_pt_regs *regs);
 extern int set_signals(int enable);
diff -puN arch/um/kernel/sys_call_table.c~add-syscalls_h arch/um/kernel/sys_call_table.c
--- 25-x86_64/arch/um/kernel/sys_call_table.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/um/kernel/sys_call_table.c	Sat Feb 21 21:40:52 2004
@@ -8,6 +8,7 @@
 #include "linux/version.h"
 #include "linux/sys.h"
 #include "linux/swap.h"
+#include "linux/syscalls.h"
 #include "linux/sysctl.h"
 #include "asm/signal.h"
 #include "sysdep/syscalls.h"
@@ -268,9 +269,9 @@ syscall_handler_t *sys_call_table[] = {
 	[ __NR_creat ] = sys_creat,
 	[ __NR_link ] = sys_link,
 	[ __NR_unlink ] = sys_unlink,
+	[ __NR_execve ] = (syscall_handler_t *) sys_execve,
 
 	/* declared differently in kern_util.h */
-	[ __NR_execve ] = (syscall_handler_t *) sys_execve,
 	[ __NR_chdir ] = sys_chdir,
 	[ __NR_time ] = um_time,
 	[ __NR_mknod ] = sys_mknod,
diff -puN include/asm-cris/unistd.h~add-syscalls_h include/asm-cris/unistd.h
--- 25-x86_64/include/asm-cris/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-cris/unistd.h	Sat Feb 21 21:40:52 2004
@@ -305,6 +305,23 @@ extern inline _syscall3(int,execve,const
 extern inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 extern inline _syscall1(int,close,int,fd)
 
+asmlinkage long sys_mmap2(
+			unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+struct pt_regs;
+asmlinkage int sys_execve(const char *fname, char **argv, char **envp,
+			long r13, long mof, long srp, struct pt_regs *regs);
+asmlinkage int sys_clone(unsigned long newusp, unsigned long flags,
+			int* parent_tid, int* child_tid, long mof, long srp,
+			struct pt_regs *regs);
+asmlinkage int sys_fork(long r10, long r11, long r12, long r13,
+			long mof, long srp, struct pt_regs *regs);
+asmlinkage int sys_vfork(long r10, long r11, long r12, long r13,
+			long mof, long srp, struct pt_regs *regs);
+asmlinkage int sys_pipe(unsigned long __user *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+
 /*
  * Since we define it "external", it collides with the built-in
  * definition, which has the "noreturn" attribute and will cause
diff -puN include/asm-h8300/unistd.h~add-syscalls_h include/asm-h8300/unistd.h
--- 25-x86_64/include/asm-h8300/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-h8300/unistd.h	Sat Feb 21 21:40:52 2004
@@ -479,6 +479,14 @@ static inline pid_t wait(int * wait_stat
 {
 	return waitpid(-1,wait_stat,0);
 }
+asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(char *name, char **argv, char **envp,
+			int dummy, ...);
+asmlinkage int sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
 
 #endif
 
diff -puN include/asm-m68knommu/unistd.h~add-syscalls_h include/asm-m68knommu/unistd.h
--- 25-x86_64/include/asm-m68knommu/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-m68knommu/unistd.h	Sat Feb 21 21:40:52 2004
@@ -371,10 +371,12 @@ type name(atype a, btype b, ctype c, dty
   }										\
   return (type)__res;								\
 }
-		
+
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <linux/interrupt.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -406,6 +408,18 @@ static inline pid_t wait(int * wait_stat
 {
 	return waitpid(-1,wait_stat,0);
 }
+asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(char *name, char **argv, char **envp);
+asmlinkage int sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
+struct pt_regs;
+int sys_request_irq(unsigned int,
+			irqreturn_t (*)(int, void *, struct pt_regs *),
+			unsigned long, const char *, void *);
+void sys_free_irq(unsigned int, void *);
 
 #endif
 
diff -puN include/asm-m68k/unistd.h~add-syscalls_h include/asm-m68k/unistd.h
--- 25-x86_64/include/asm-m68k/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-m68k/unistd.h	Sat Feb 21 21:40:52 2004
@@ -339,6 +339,8 @@ __syscall_return(type,__res); \
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <linux/interrupt.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -363,6 +365,20 @@ static inline _syscall1(int,close,int,fd
 static inline _syscall1(int,_exit,int,exitcode)
 static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
+asmlinkage long sys_mmap2(
+			unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(char *name, char **argv, char **envp);
+asmlinkage int sys_pipe(unsigned long *fildes);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
+struct pt_regs;
+int sys_request_irq(unsigned int,
+			irqreturn_t (*)(int, void *, struct pt_regs *),
+			unsigned long, const char *, void *);
+void sys_free_irq(unsigned int, void *);
+
 #endif
 
 /*
diff -puN include/asm-sh/unistd.h~add-syscalls_h include/asm-sh/unistd.h
--- 25-x86_64/include/asm-sh/unistd.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-sh/unistd.h	Sat Feb 21 21:40:52 2004
@@ -402,6 +402,8 @@ __syscall_return(type,__sc0); \
 
 #ifdef __KERNEL_SYSCALLS__
 
+#include <asm/ptrace.h>
+
 /*
  * we need this inline - forking from kernel space will result
  * in NO COPY ON WRITE (!!!), until an execve is executed. This
@@ -433,6 +435,33 @@ static __inline__ pid_t wait(int * wait_
 {
 	return waitpid(-1,wait_stat,0);
 }
+
+asmlinkage long sys_mmap2(
+			unsigned long addr, unsigned long len,
+			unsigned long prot, unsigned long flags,
+			unsigned long fd, unsigned long pgoff);
+asmlinkage int sys_execve(char *ufilename, char **uargv,
+			char **uenvp, unsigned long r7,
+			struct pt_regs regs);
+asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
+			unsigned long parent_tidptr,
+			unsigned long child_tidptr,
+			struct pt_regs regs);
+asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
+			unsigned long r6, unsigned long r7,
+			struct pt_regs regs);
+asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
+			unsigned long r6, unsigned long r7,
+			struct pt_regs regs);
+asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
+			unsigned long r6, unsigned long r7,
+			struct pt_regs regs);
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf,
+				size_t count, long dummy, loff_t pos);
+asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf,
+				size_t count, long dummy, loff_t pos);
+
 #endif
 
 /*
diff -puN include/linux/sched.h~add-syscalls_h include/linux/sched.h
--- 25-x86_64/include/linux/sched.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/sched.h	Sat Feb 21 21:40:52 2004
@@ -710,8 +710,6 @@ extern void FASTCALL(wake_up_forked_proc
 extern void FASTCALL(sched_fork(task_t * p));
 extern void FASTCALL(sched_exit(task_t * p));
 
-asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
-
 extern int in_group_p(gid_t);
 extern int in_egroup_p(gid_t);
 
@@ -835,8 +833,6 @@ extern task_t *child_reaper;
 extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *);
 extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
 extern struct task_struct * copy_process(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
-extern asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
-					      struct sched_param __user *parm);
 
 #ifdef CONFIG_SMP
 extern void wait_task_inactive(task_t * p);
diff -puN init/main.c~add-syscalls_h init/main.c
--- 25-x86_64/init/main.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/init/main.c	Sat Feb 21 21:40:52 2004
@@ -12,10 +12,12 @@
 #define __KERNEL_SYSCALLS__
 
 #include <linux/config.h>
+#include <linux/types.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/kernel.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
diff -puN kernel/kmod.c~add-syscalls_h kernel/kmod.c
--- 25-x86_64/kernel/kmod.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/kmod.c	Sat Feb 21 21:40:52 2004
@@ -23,6 +23,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/kmod.h>
 #include <linux/smp_lock.h>
diff -puN arch/x86_64/ia32/ptrace32.c~add-syscalls_h arch/x86_64/ia32/ptrace32.c
--- 25-x86_64/arch/x86_64/ia32/ptrace32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/ia32/ptrace32.c	Sat Feb 21 21:40:52 2004
@@ -14,6 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
+#include <linux/unistd.h>
 #include <linux/mm.h>
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
@@ -223,8 +225,6 @@ static struct task_struct *find_target(i
 	
 } 
 
-extern asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, unsigned long data);
-
 asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 {
 	struct task_struct *child;
diff -puN include/linux/msg.h~add-syscalls_h include/linux/msg.h
--- 25-x86_64/include/linux/msg.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/msg.h	Sat Feb 21 21:40:52 2004
@@ -94,11 +94,6 @@ struct msg_queue {
 	struct list_head q_senders;
 };
 
-asmlinkage long sys_msgget (key_t key, int msgflg);
-asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg);
-asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz, long msgtyp, int msgflg);
-asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf);
-
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_MSG_H */
diff -puN include/linux/sem.h~add-syscalls_h include/linux/sem.h
--- 25-x86_64/include/linux/sem.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/sem.h	Sat Feb 21 21:40:52 2004
@@ -134,12 +134,6 @@ struct sysv_sem {
 	struct sem_undo_list *undo_list;
 };
 
-asmlinkage long sys_semget (key_t key, int nsems, int semflg);
-asmlinkage long sys_semop (int semid, struct sembuf __user *sops, unsigned nsops);
-asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg);
-asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
-			unsigned nsops, const struct timespec __user *timeout);
-
 void exit_sem(struct task_struct *p);
 
 #endif /* __KERNEL__ */
diff -puN ipc/sem.c~add-syscalls_h ipc/sem.c
--- 25-x86_64/ipc/sem.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/ipc/sem.c	Sat Feb 21 21:40:52 2004
@@ -1011,11 +1011,6 @@ out:
 	return un;
 }
 
-asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops)
-{
-	return sys_semtimedop(semid, tsops, nsops, NULL);
-}
-
 asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
 			unsigned nsops, const struct timespec __user *timeout)
 {
@@ -1181,6 +1176,11 @@ out_free:
 	return error;
 }
 
+asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops)
+{
+	return sys_semtimedop(semid, tsops, nsops, NULL);
+}
+
 /* If CLONE_SYSVSEM is set, establish sharing of SEM_UNDO state between
  * parent and child tasks.
  *
diff -puN arch/cris/kernel/sys_cris.c~add-syscalls_h arch/cris/kernel/sys_cris.c
--- 25-x86_64/arch/cris/kernel/sys_cris.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/cris/kernel/sys_cris.c	Sat Feb 21 21:40:52 2004
@@ -11,6 +11,7 @@
 
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -puN arch/mips/kernel/syscall.c~add-syscalls_h arch/mips/kernel/syscall.c
--- 25-x86_64/arch/mips/kernel/syscall.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/mips/kernel/syscall.c	Sat Feb 21 21:40:52 2004
@@ -16,6 +16,7 @@
 #include <linux/ptrace.h>
 #include <linux/sched.h>
 #include <linux/string.h>
+#include <linux/syscalls.h>
 #include <linux/file.h>
 #include <linux/slab.h>
 #include <linux/utsname.h>
diff -puN arch/parisc/kernel/ioctl32.c~add-syscalls_h arch/parisc/kernel/ioctl32.c
--- 25-x86_64/arch/parisc/kernel/ioctl32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/parisc/kernel/ioctl32.c	Sat Feb 21 21:40:52 2004
@@ -8,6 +8,8 @@
  * ioctls.
  */
 
+#include <linux/syscalls.h>
+
 #define INCLUDES
 #include "compat_ioctl.c"
 
diff -puN arch/ppc64/kernel/ioctl32.c~add-syscalls_h arch/ppc64/kernel/ioctl32.c
--- 25-x86_64/arch/ppc64/kernel/ioctl32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ppc64/kernel/ioctl32.c	Sat Feb 21 21:40:52 2004
@@ -23,6 +23,7 @@
 #define INCLUDES
 #include "compat_ioctl.c"
 #include <linux/ncp_fs.h>
+#include <linux/syscalls.h>
 #include <asm/ppc32.h>
 
 #define CODE
diff -puN arch/ppc64/kernel/syscalls.c~add-syscalls_h arch/ppc64/kernel/syscalls.c
--- 25-x86_64/arch/ppc64/kernel/syscalls.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ppc64/kernel/syscalls.c	Sat Feb 21 21:40:52 2004
@@ -22,6 +22,7 @@
 
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -puN arch/s390/kernel/s390_ksyms.c~add-syscalls_h arch/s390/kernel/s390_ksyms.c
--- 25-x86_64/arch/s390/kernel/s390_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/s390/kernel/s390_ksyms.c	Sat Feb 21 21:40:52 2004
@@ -8,6 +8,7 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
+#include <linux/syscalls.h>
 #include <linux/interrupt.h>
 #include <linux/ioctl32.h>
 #include <asm/checksum.h>
diff -puN arch/sparc64/kernel/ioctl32.c~add-syscalls_h arch/sparc64/kernel/ioctl32.c
--- 25-x86_64/arch/sparc64/kernel/ioctl32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/sparc64/kernel/ioctl32.c	Sat Feb 21 21:40:52 2004
@@ -12,6 +12,7 @@
 #define INCLUDES
 #include "compat_ioctl.c"
 #include <linux/ncp_fs.h>
+#include <linux/syscalls.h>
 #include <asm/fbio.h>
 #include <asm/kbio.h>
 #include <asm/vuid_event.h>
diff -puN arch/um/kernel/syscall_kern.c~add-syscalls_h arch/um/kernel/syscall_kern.c
--- 25-x86_64/arch/um/kernel/syscall_kern.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/um/kernel/syscall_kern.c	Sat Feb 21 21:40:52 2004
@@ -11,6 +11,7 @@
 #include "linux/msg.h"
 #include "linux/shm.h"
 #include "linux/sys.h"
+#include "linux/syscalls.h"
 #include "linux/unistd.h"
 #include "linux/slab.h"
 #include "linux/utime.h"
diff -puN arch/v850/kernel/syscalls.c~add-syscalls_h arch/v850/kernel/syscalls.c
--- 25-x86_64/arch/v850/kernel/syscalls.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/v850/kernel/syscalls.c	Sat Feb 21 21:40:52 2004
@@ -20,6 +20,7 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/syscalls.h>
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/shm.h>
diff -puN arch/x86_64/ia32/ipc32.c~add-syscalls_h arch/x86_64/ia32/ipc32.c
--- 25-x86_64/arch/x86_64/ia32/ipc32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/ia32/ipc32.c	Sat Feb 21 21:40:52 2004
@@ -2,6 +2,7 @@
 #include <linux/sched.h>
 #include <linux/fs.h> 
 #include <linux/file.h> 
+#include <linux/syscalls.h>
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/mm.h>
diff -puN arch/x86_64/kernel/sys_x86_64.c~add-syscalls_h arch/x86_64/kernel/sys_x86_64.c
--- 25-x86_64/arch/x86_64/kernel/sys_x86_64.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/x86_64/kernel/sys_x86_64.c	Sat Feb 21 21:40:52 2004
@@ -4,6 +4,7 @@
 
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -puN fs/compat_ioctl.c~add-syscalls_h fs/compat_ioctl.c
--- 25-x86_64/fs/compat_ioctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/compat_ioctl.c	Sat Feb 21 21:40:52 2004
@@ -62,6 +62,7 @@
 #include <linux/if_tun.h>
 #include <linux/ctype.h>
 #include <linux/ioctl32.h>
+#include <linux/syscalls.h>
 #include <linux/ncp_fs.h>
 #include <linux/i2c.h>
 #include <linux/i2c-dev.h>
diff -puN fs/nfsd/export.c~add-syscalls_h fs/nfsd/export.c
--- 25-x86_64/fs/nfsd/export.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/nfsd/export.c	Sat Feb 21 21:40:52 2004
@@ -20,6 +20,7 @@
 #include <linux/stat.h>
 #include <linux/in.h>
 #include <linux/seq_file.h>
+#include <linux/syscalls.h>
 #include <linux/rwsem.h>
 #include <linux/dcache.h>
 #include <linux/namei.h>
diff -puN fs/nfsd/nfsctl.c~add-syscalls_h fs/nfsd/nfsctl.c
--- 25-x86_64/fs/nfsd/nfsctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/nfsd/nfsctl.c	Sat Feb 21 21:40:52 2004
@@ -16,6 +16,7 @@
 #include <linux/fcntl.h>
 #include <linux/net.h>
 #include <linux/in.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/slab.h>
 #include <linux/proc_fs.h>
diff -puN include/asm-x86_64/compat.h~add-syscalls_h include/asm-x86_64/compat.h
--- 25-x86_64/include/asm-x86_64/compat.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-x86_64/compat.h	Sat Feb 21 21:40:52 2004
@@ -28,6 +28,7 @@ typedef u16		compat_ipc_pid_t;
 typedef s32		compat_daddr_t;
 typedef u32		compat_caddr_t;
 typedef __kernel_fsid_t	compat_fsid_t;
+typedef u32		compat_timer_t;
 
 typedef s32		compat_int_t;
 typedef s32		compat_long_t;
diff -puN include/linux/eventpoll.h~add-syscalls_h include/linux/eventpoll.h
--- 25-x86_64/include/linux/eventpoll.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/eventpoll.h	Sat Feb 21 21:40:52 2004
@@ -49,13 +49,6 @@ struct epoll_event {
 struct file;
 
 
-/* Kernel space functions implementing the user space "epoll" API */
-asmlinkage long sys_epoll_create(int size);
-asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
-			      struct epoll_event __user *event);
-asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
-			       int maxevents, int timeout);
-
 #ifdef CONFIG_EPOLL
 
 /* Used to initialize the epoll bits inside the "struct file" */
diff -puN include/linux/futex.h~add-syscalls_h include/linux/futex.h
--- 25-x86_64/include/linux/futex.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/futex.h	Sat Feb 21 21:40:52 2004
@@ -10,10 +10,6 @@
 #define FUTEX_REQUEUE (3)
 
 
-asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
-			  struct timespec __user *utime, u32 __user *uaddr2);
-
-
 long do_futex(unsigned long uaddr, int op, int val,
 		unsigned long timeout, unsigned long uaddr2, int val2);
 
diff -puN include/linux/ioctl32.h~add-syscalls_h include/linux/ioctl32.h
--- 25-x86_64/include/linux/ioctl32.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/ioctl32.h	Sat Feb 21 21:40:52 2004
@@ -3,8 +3,6 @@
 
 struct file;
 
-extern long sys_ioctl(unsigned int, unsigned int, unsigned long);
-
 /* 
  * Register an 32bit ioctl translation handler for ioctl cmd.
  *
diff -puN include/linux/mm.h~add-syscalls_h include/linux/mm.h
--- 25-x86_64/include/linux/mm.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/mm.h	Sat Feb 21 21:40:52 2004
@@ -455,8 +455,6 @@ extern int install_file_pte(struct mm_st
 extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
 extern int make_pages_present(unsigned long addr, unsigned long end);
 extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
-extern long sys_remap_file_pages(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long nonblock);
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
 void put_dirty_page(struct task_struct *tsk, struct page *page,
 			unsigned long address, pgprot_t prot);
 
diff -puN include/linux/nfsd/syscall.h~add-syscalls_h include/linux/nfsd/syscall.h
--- 25-x86_64/include/linux/nfsd/syscall.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/nfsd/syscall.h	Sat Feb 21 21:40:52 2004
@@ -115,7 +115,6 @@ union nfsctl_res {
 /*
  * Kernel syscall implementation.
  */
-extern asmlinkage long	sys_nfsservctl(int, struct nfsctl_arg __user *, void __user *);
 extern int		exp_addclient(struct nfsctl_client *ncp);
 extern int		exp_delclient(struct nfsctl_client *ncp);
 extern int		exp_export(struct nfsctl_export *nxp);
diff -puN include/linux/shm.h~add-syscalls_h include/linux/shm.h
--- 25-x86_64/include/linux/shm.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/shm.h	Sat Feb 21 21:40:52 2004
@@ -90,11 +90,6 @@ struct shmid_kernel /* private to the ke
 #define SHM_LOCKED      02000   /* segment will not be swapped */
 #define SHM_HUGETLB     04000   /* segment will use huge TLB pages */
 
-long sys_shmat (int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
-asmlinkage long sys_shmget (key_t key, size_t size, int flag);
-asmlinkage long sys_shmdt (char __user *shmaddr);
-asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf);
-
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_SHM_H_ */
diff -puN include/linux/socket.h~add-syscalls_h include/linux/socket.h
--- 25-x86_64/include/linux/socket.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/socket.h	Sat Feb 21 21:40:52 2004
@@ -245,10 +245,6 @@ struct ucred {
 #define MSG_CMSG_COMPAT	0		/* We never have 32 bit fixups */
 #endif
 
-extern asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags);
-extern asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags);
-
-
 
 /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
 #define SOL_IP		0
diff -puN kernel/fork.c~add-syscalls_h kernel/fork.c
--- 25-x86_64/kernel/fork.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/fork.c	Sat Feb 21 21:40:52 2004
@@ -26,6 +26,7 @@
 #include <linux/mman.h>
 #include <linux/fs.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 #include <linux/jiffies.h>
 #include <linux/futex.h>
 #include <linux/ptrace.h>
diff -puN kernel/module.c~add-syscalls_h kernel/module.c
--- 25-x86_64/kernel/module.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/kernel/module.c	Sat Feb 21 21:40:52 2004
@@ -24,6 +24,7 @@
 #include <linux/vmalloc.h>
 #include <linux/elf.h>
 #include <linux/seq_file.h>
+#include <linux/syscalls.h>
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
 #include <linux/cpu.h>
diff -puN mm/mmap.c~add-syscalls_h mm/mmap.c
--- 25-x86_64/mm/mmap.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/mm/mmap.c	Sat Feb 21 21:40:52 2004
@@ -11,6 +11,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/swap.h>
+#include <linux/syscalls.h>
 #include <linux/init.h>
 #include <linux/file.h>
 #include <linux/fs.h>
diff -puN arch/alpha/kernel/alpha_ksyms.c~add-syscalls_h arch/alpha/kernel/alpha_ksyms.c
--- 25-x86_64/arch/alpha/kernel/alpha_ksyms.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/alpha/kernel/alpha_ksyms.c	Sat Feb 21 21:40:52 2004
@@ -11,6 +11,7 @@
 #include <linux/user.h>
 #include <linux/elfcore.h>
 #include <linux/socket.h>
+#include <linux/syscalls.h>
 #include <linux/in.h>
 #include <linux/in6.h>
 #include <linux/pci.h>
diff -puN drivers/media/dvb/frontends/alps_tdlb7.c~add-syscalls_h drivers/media/dvb/frontends/alps_tdlb7.c
--- 25-x86_64/drivers/media/dvb/frontends/alps_tdlb7.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/drivers/media/dvb/frontends/alps_tdlb7.c	Sat Feb 21 21:40:52 2004
@@ -35,6 +35,7 @@
 #include <linux/init.h>
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
+#include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/delay.h>
 
diff -puN drivers/media/dvb/frontends/sp887x.c~add-syscalls_h drivers/media/dvb/frontends/sp887x.c
--- 25-x86_64/drivers/media/dvb/frontends/sp887x.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/drivers/media/dvb/frontends/sp887x.c	Sat Feb 21 21:40:52 2004
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/slab.h>
+#include <linux/syscalls.h>
 #include <linux/fs.h>
 #include <linux/unistd.h>
 #include <linux/fcntl.h>
diff -puN drivers/media/dvb/frontends/tda1004x.c~add-syscalls_h drivers/media/dvb/frontends/tda1004x.c
--- 25-x86_64/drivers/media/dvb/frontends/tda1004x.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/drivers/media/dvb/frontends/tda1004x.c	Sat Feb 21 21:40:52 2004
@@ -37,6 +37,7 @@
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/slab.h>
+#include <linux/syscalls.h>
 #include <linux/fs.h>
 #include <linux/unistd.h>
 #include <linux/fcntl.h>
diff -puN fs/binfmt_elf.c~add-syscalls_h fs/binfmt_elf.c
--- 25-x86_64/fs/binfmt_elf.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/binfmt_elf.c	Sat Feb 21 21:40:52 2004
@@ -36,6 +36,7 @@
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 
 #include <asm/uaccess.h>
 #include <asm/param.h>
diff -puN fs/binfmt_misc.c~add-syscalls_h fs/binfmt_misc.c
--- 25-x86_64/fs/binfmt_misc.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/binfmt_misc.c	Sat Feb 21 21:40:52 2004
@@ -26,6 +26,7 @@
 #include <linux/pagemap.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
+#include <linux/syscalls.h>
 
 #include <asm/uaccess.h>
 
diff -puN fs/eventpoll.c~add-syscalls_h fs/eventpoll.c
--- 25-x86_64/fs/eventpoll.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/eventpoll.c	Sat Feb 21 21:40:52 2004
@@ -27,6 +27,7 @@
 #include <linux/list.h>
 #include <linux/hash.h>
 #include <linux/spinlock.h>
+#include <linux/syscalls.h>
 #include <linux/rwsem.h>
 #include <linux/wait.h>
 #include <linux/eventpoll.h>
diff -puN fs/exec.c~add-syscalls_h fs/exec.c
--- 25-x86_64/fs/exec.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/fs/exec.c	Sat Feb 21 21:40:52 2004
@@ -44,6 +44,7 @@
 #include <linux/ptrace.h>
 #include <linux/mount.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 #include <linux/rmap-locking.h>
 
 #include <asm/uaccess.h>
diff -puN include/linux/fs.h~add-syscalls_h include/linux/fs.h
--- 25-x86_64/include/linux/fs.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/linux/fs.h	Sat Feb 21 21:40:52 2004
@@ -1122,10 +1122,7 @@ static inline int break_lease(struct ino
 
 /* fs/open.c */
 
-asmlinkage long sys_open(const char __user *, int, int);
-asmlinkage long sys_close(unsigned int);	/* yes, it's really unsigned */
 extern int do_truncate(struct dentry *, loff_t start);
-
 extern struct file *filp_open(const char *, int, int);
 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
 extern int filp_close(struct file *, fl_owner_t id);
diff -puN net/socket.c~add-syscalls_h net/socket.c
--- 25-x86_64/net/socket.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/net/socket.c	Sat Feb 21 21:40:52 2004
@@ -78,6 +78,7 @@
 #include <linux/divert.h>
 #include <linux/mount.h>
 #include <linux/security.h>
+#include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <linux/kmod.h>
 
diff -puN security/selinux/hooks.c~add-syscalls_h security/selinux/hooks.c
--- 25-x86_64/security/selinux/hooks.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/security/selinux/hooks.c	Sat Feb 21 21:40:52 2004
@@ -34,6 +34,7 @@
 #include <linux/swap.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
+#include <linux/syscalls.h>
 #include <linux/file.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
diff -puN arch/m68k/amiga/amiints.c~add-syscalls_h arch/m68k/amiga/amiints.c
--- 25-x86_64/arch/m68k/amiga/amiints.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/amiga/amiints.c	Sat Feb 21 21:40:52 2004
@@ -49,6 +49,7 @@
 #include <asm/amigahw.h>
 #include <asm/amigaints.h>
 #include <asm/amipcmcia.h>
+#include <asm/unistd.h>
 
 extern int cia_request_irq(struct ciabase *base,int irq,
                            irqreturn_t (*handler)(int, void *, struct pt_regs *),
diff -puN arch/m68k/bvme6000/bvmeints.c~add-syscalls_h arch/m68k/bvme6000/bvmeints.c
--- 25-x86_64/arch/m68k/bvme6000/bvmeints.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/bvme6000/bvmeints.c	Sat Feb 21 21:40:52 2004
@@ -20,6 +20,7 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
+#include <asm/unistd.h>
 
 static irqreturn_t bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp);
 
diff -puN arch/m68k/hp300/time.c~add-syscalls_h arch/m68k/hp300/time.c
--- 25-x86_64/arch/m68k/hp300/time.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/hp300/time.c	Sat Feb 21 21:40:52 2004
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/traps.h>
+#include <asm/unistd.h>
 #include "ints.h"
 
 /* Clock hardware definitions */
diff -puN arch/m68k/mac/iop.c~add-syscalls_h arch/m68k/mac/iop.c
--- 25-x86_64/arch/m68k/mac/iop.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/mac/iop.c	Sat Feb 21 21:40:52 2004
@@ -118,6 +118,7 @@
 #include <asm/macints.h> 
 #include <asm/mac_iop.h>
 #include <asm/mac_oss.h>
+#include <asm/unistd.h>
 
 /*#define DEBUG_IOP*/
 
diff -puN arch/m68k/mac/macints.c~add-syscalls_h arch/m68k/mac/macints.c
--- 25-x86_64/arch/m68k/mac/macints.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/mac/macints.c	Sat Feb 21 21:40:52 2004
@@ -132,8 +132,8 @@
 #include <asm/mac_psc.h>
 #include <asm/hwtest.h>
 #include <asm/errno.h>
-
 #include <asm/macints.h>
+#include <asm/unistd.h>
 
 #define DEBUG_SPURIOUS
 #define SHUTUP_SONIC
diff -puN arch/m68k/mac/oss.c~add-syscalls_h arch/m68k/mac/oss.c
--- 25-x86_64/arch/m68k/mac/oss.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/mac/oss.c	Sat Feb 21 21:40:52 2004
@@ -26,6 +26,7 @@
 #include <asm/macints.h>
 #include <asm/mac_via.h>
 #include <asm/mac_oss.h>
+#include <asm/unistd.h>
 
 int oss_present;
 volatile struct mac_oss *oss;
diff -puN arch/m68k/mac/psc.c~add-syscalls_h arch/m68k/mac/psc.c
--- 25-x86_64/arch/m68k/mac/psc.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/mac/psc.c	Sat Feb 21 21:40:52 2004
@@ -24,6 +24,7 @@
 #include <asm/macintosh.h> 
 #include <asm/macints.h> 
 #include <asm/mac_psc.h>
+#include <asm/unistd.h>
 
 #define DEBUG_PSC
 
diff -puN arch/m68k/mac/via.c~add-syscalls_h arch/m68k/mac/via.c
--- 25-x86_64/arch/m68k/mac/via.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/mac/via.c	Sat Feb 21 21:40:52 2004
@@ -23,7 +23,6 @@
 #include <linux/mm.h>
 #include <linux/delay.h>
 #include <linux/init.h>
-
 #include <linux/ide.h>
 
 #include <asm/traps.h>
@@ -33,6 +32,7 @@
 #include <asm/machw.h> 
 #include <asm/mac_via.h>
 #include <asm/mac_psc.h>
+#include <asm/unistd.h>
 
 volatile __u8 *via1, *via2;
 #if 0
diff -puN arch/m68k/q40/q40ints.c~add-syscalls_h arch/m68k/q40/q40ints.c
--- 25-x86_64/arch/m68k/q40/q40ints.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/q40/q40ints.c	Sat Feb 21 21:40:52 2004
@@ -26,6 +26,7 @@
 #include <asm/irq.h>
 #include <asm/hardirq.h>
 #include <asm/traps.h>
+#include <asm/unistd.h>
 
 #include <asm/q40_master.h>
 #include <asm/q40ints.h>
diff -puN arch/m68k/sun3/sun3ints.c~add-syscalls_h arch/m68k/sun3/sun3ints.c
--- 25-x86_64/arch/m68k/sun3/sun3ints.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/m68k/sun3/sun3ints.c	Sat Feb 21 21:40:52 2004
@@ -15,6 +15,7 @@
 #include <asm/intersil.h>
 #include <asm/oplib.h>
 #include <asm/sun3ints.h>
+#include <asm/unistd.h>
 #include <linux/seq_file.h>
 
 extern void sun3_leds (unsigned char);
diff -puN arch/ppc64/kernel/signal32.c~add-syscalls_h arch/ppc64/kernel/signal32.c
--- 25-x86_64/arch/ppc64/kernel/signal32.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/arch/ppc64/kernel/signal32.c	Sat Feb 21 21:40:52 2004
@@ -21,6 +21,7 @@
 #include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/elf.h>
 #include <linux/compat.h>
diff -puN drivers/char/vt_ioctl.c~add-syscalls_h drivers/char/vt_ioctl.c
--- 25-x86_64/drivers/char/vt_ioctl.c~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/drivers/char/vt_ioctl.c	Sat Feb 21 21:40:52 2004
@@ -60,7 +60,7 @@ struct vt_struct *vt_cons[MAX_NR_CONSOLE
 unsigned char keyboard_type = KB_101;
 
 #ifdef CONFIG_X86
-asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
+#include <linux/syscalls.h>
 #endif
 
 /*
diff -puN include/asm-m68k/irq.h~add-syscalls_h include/asm-m68k/irq.h
--- 25-x86_64/include/asm-m68k/irq.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-m68k/irq.h	Sat Feb 21 21:40:52 2004
@@ -76,11 +76,6 @@ extern void (*disable_irq)(unsigned int)
 
 struct pt_regs;
 
-extern int sys_request_irq(unsigned int, 
-	irqreturn_t (*)(int, void *, struct pt_regs *), 
-	unsigned long, const char *, void *);
-extern void sys_free_irq(unsigned int, void *);
-
 /*
  * various flags for request_irq() - the Amiga now uses the standard
  * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
diff -puN include/asm-m68knommu/irq.h~add-syscalls_h include/asm-m68knommu/irq.h
--- 25-x86_64/include/asm-m68knommu/irq.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-m68knommu/irq.h	Sat Feb 21 21:40:52 2004
@@ -62,11 +62,6 @@
 extern void (*mach_enable_irq)(unsigned int);
 extern void (*mach_disable_irq)(unsigned int);
 
-extern int sys_request_irq(unsigned int, 
-	irqreturn_t (*)(int, void *, struct pt_regs *), 
-	unsigned long, const char *, void *);
-extern void sys_free_irq(unsigned int, void *);
-
 /*
  * various flags for request_irq() - the Amiga now uses the standard
  * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
diff -puN include/asm-ppc64/signal.h~add-syscalls_h include/asm-ppc64/signal.h
--- 25-x86_64/include/asm-ppc64/signal.h~add-syscalls_h	Sat Feb 21 21:40:49 2004
+++ 25-x86_64-akpm/include/asm-ppc64/signal.h	Sat Feb 21 21:40:52 2004
@@ -148,15 +148,6 @@ struct pt_regs;
 struct timespec;
 extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
 extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
-extern long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset,
-			       size_t sigsetsize);
-extern long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-extern long sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
-				const struct timespec *uts, size_t sigsetsize);
-extern long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
 
-struct pt_regs;
-int do_signal32(sigset_t *oldset, struct pt_regs *regs);
-
 #endif /* _ASMPPC64_SIGNAL_H */

_