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.



---

 arch/alpha/kernel/osf_sys.c         |    3 
 arch/ia64/ia32/ia32_ioctl.c         |    3 
 arch/ia64/ia32/sys_ia32.c           |   28 --
 arch/mips/kernel/ioctl32.c          |    3 
 arch/mips/kernel/irixioctl.c        |    4 
 arch/mips/kernel/linux32.c          |   13 -
 arch/mips/kernel/sysirix.c          |   15 -
 arch/parisc/hpux/ioctl.c            |    3 
 arch/parisc/hpux/sys_hpux.c         |    4 
 arch/parisc/kernel/sys_parisc.c     |   14 -
 arch/parisc/kernel/sys_parisc32.c   |    7 
 arch/ppc64/kernel/ppc_ksyms.c       |    2 
 arch/ppc64/kernel/sys_ppc32.c       |   55 ----
 arch/s390/kernel/compat_linux.c     |   28 --
 arch/s390/kernel/compat_linux.h     |    1 
 arch/s390/kernel/sys_s390.c         |    3 
 arch/sparc/kernel/sunos_ioctl.c     |    2 
 arch/sparc/kernel/sys_sunos.c       |    5 
 arch/sparc64/kernel/sparc64_ksyms.c |    2 
 arch/sparc64/kernel/sunos_ioctl32.c |    3 
 arch/sparc64/kernel/sys_sparc.c     |    3 
 arch/sparc64/kernel/sys_sparc32.c   |   39 ---
 arch/sparc64/kernel/sys_sunos32.c   |    3 
 arch/sparc64/solaris/ioctl.c        |    3 
 arch/sparc64/solaris/socksys.c      |    3 
 arch/sparc64/solaris/timod.c        |    2 
 arch/x86_64/ia32/ia32_ioctl.c       |    3 
 arch/x86_64/ia32/sys_ia32.c         |   27 --
 arch/x86_64/kernel/x8664_ksyms.c    |    3 
 drivers/macintosh/via-pmu.c         |    3 
 fs/compat.c                         |   14 -
 include/asm-alpha/unistd.h          |   11 
 include/asm-arm/unistd.h            |    9 
 include/asm-arm26/unistd.h          |   14 -
 include/asm-i386/unistd.h           |    1 
 include/asm-ia64/unistd.h           |   18 -
 include/asm-mips/unistd.h           |    5 
 include/asm-parisc/unistd.h         |   16 -
 include/asm-ppc/unistd.h            |    4 
 include/asm-ppc64/unistd.h          |    4 
 include/asm-s390/unistd.h           |    3 
 include/asm-sparc/unistd.h          |    5 
 include/asm-sparc64/unistd.h        |    5 
 include/asm-um/unistd.h             |   15 -
 include/asm-v850/unistd.h           |    4 
 include/asm-x86_64/unistd.h         |   21 -
 include/linux/syscalls.h            |  458 ++++++++++++++++++++++++++++++++++++
 include/linux/sysctl.h              |    1 
 init/do_mounts.h                    |   15 -
 init/do_mounts_devfs.c              |    9 
 init/initramfs.c                    |   12 
 kernel/compat.c                     |   31 --
 kernel/panic.c                      |    3 
 kernel/power/disk.c                 |    3 
 kernel/power/swsusp.c               |    3 
 kernel/sysctl.c                     |    2 
 kernel/uid16.c                      |   13 -
 net/compat.c                        |   23 -
 58 files changed, 554 insertions(+), 455 deletions(-)

diff -puN arch/alpha/kernel/osf_sys.c~add-syscalls_h arch/alpha/kernel/osf_sys.c
--- 25/arch/alpha/kernel/osf_sys.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/alpha/kernel/osf_sys.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -1315,8 +1316,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/arch/ia64/ia32/ia32_ioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/ia64/ia32/ia32_ioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/ia64/ia32/sys_ia32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/ia64/ia32/sys_ia32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -82,8 +83,6 @@
 #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);
 
@@ -949,9 +948,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)
 {
@@ -2307,8 +2303,6 @@ struct sysctl32 {
 	unsigned int	__unused[4];
 };
 
-extern asmlinkage long sys_sysctl(struct __sysctl_args *args);
-
 asmlinkage long
 sys32_sysctl (struct sysctl32 *args)
 {
@@ -2497,16 +2491,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 +2585,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;
@@ -2677,7 +2666,6 @@ sys32_pwrite (unsigned int fd, void *buf
 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 +2686,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)
@@ -3090,9 +3077,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 +3141,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 +3150,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 +3162,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 +3172,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 +3301,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/arch/mips/kernel/ioctl32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/mips/kernel/ioctl32.c	2004-02-11 23:08:27.000000000 -0800
@@ -60,6 +60,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>
@@ -94,8 +95,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/arch/mips/kernel/irixioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/mips/kernel/irixioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/mips/kernel/linux32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/mips/kernel/linux32.c	2004-02-11 23:08:27.000000000 -0800
@@ -24,6 +24,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>
@@ -133,8 +134,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)
 {
@@ -633,10 +632,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)
@@ -1734,8 +1729,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;
@@ -1820,8 +1813,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)
 {
@@ -1842,8 +1833,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/arch/mips/kernel/sysirix.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/mips/kernel/sysirix.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -238,8 +239,6 @@ extern unsigned long irix_mapelf(int fd,
 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);
@@ -694,9 +693,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)
@@ -1356,8 +1352,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;
@@ -1532,10 +1526,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 +2096,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/arch/parisc/hpux/ioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/parisc/hpux/ioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/parisc/hpux/sys_hpux.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/parisc/hpux/sys_hpux.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -269,9 +270,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/arch/parisc/kernel/sys_parisc32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/parisc/kernel/sys_parisc32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -1089,7 +1090,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 +1197,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 +1344,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 +1364,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/arch/parisc/kernel/sys_parisc.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/parisc/kernel/sys_parisc.c	2004-02-11 23:08:27.000000000 -0800
@@ -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)
 {
diff -puN arch/ppc64/kernel/ppc_ksyms.c~add-syscalls_h arch/ppc64/kernel/ppc_ksyms.c
--- 25/arch/ppc64/kernel/ppc_ksyms.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/ppc_ksyms.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/ppc64/kernel/sys_ppc32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/sys_ppc32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -778,8 +780,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 +1155,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 +1866,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 +1890,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();
@@ -2196,9 +2190,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 +2199,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,
@@ -2295,8 +2280,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 +2293,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 +2304,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)
@@ -2413,8 +2392,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)
@@ -2433,8 +2410,6 @@ long sys32_nice(u32 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 +2447,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)
@@ -2562,8 +2535,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)
@@ -2588,8 +2559,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 */
@@ -2630,8 +2599,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 */
@@ -2652,8 +2619,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 +2721,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)
@@ -2813,11 +2774,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 +2787,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 +2804,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)
 {
diff -puN arch/s390/kernel/compat_linux.c~add-syscalls_h arch/s390/kernel/compat_linux.c
--- 25/arch/s390/kernel/compat_linux.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/s390/kernel/compat_linux.c	2004-02-11 23:08:27.000000000 -0800
@@ -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,15 +72,8 @@
 
 #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);
  
@@ -925,9 +919,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)
@@ -2361,12 +2352,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 +2368,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 +2392,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)
 {
@@ -2718,8 +2696,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 +2704,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/arch/s390/kernel/compat_linux.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/s390/kernel/compat_linux.h	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/s390/kernel/sys_s390.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/s390/kernel/sys_s390.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -310,8 +311,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;
diff -puN arch/sparc64/kernel/sparc64_ksyms.c~add-syscalls_h arch/sparc64/kernel/sparc64_ksyms.c
--- 25/arch/sparc64/kernel/sparc64_ksyms.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/kernel/sparc64_ksyms.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
 
@@ -92,7 +93,6 @@ 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);
diff -puN arch/sparc64/kernel/sunos_ioctl32.c~add-syscalls_h arch/sparc64/kernel/sunos_ioctl32.c
--- 25/arch/sparc64/kernel/sunos_ioctl32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/kernel/sunos_ioctl32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/sparc64/kernel/sys_sparc32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/kernel/sys_sparc32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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,15 +89,8 @@
 	__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);
  
@@ -836,9 +830,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)
@@ -2457,17 +2448,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 +2467,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 +2477,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 +2489,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 +2505,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 +2524,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();
@@ -2790,8 +2755,6 @@ asmlinkage long sys32_sysctl(struct __sy
 	return error;
 }
 
-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/arch/sparc64/kernel/sys_sparc.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/kernel/sys_sparc.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
 
@@ -292,8 +293,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/arch/sparc64/kernel/sys_sunos32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/kernel/sys_sunos32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -1200,8 +1201,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);
diff -puN arch/sparc64/solaris/ioctl.c~add-syscalls_h arch/sparc64/solaris/ioctl.c
--- 25/arch/sparc64/solaris/ioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/solaris/ioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/sparc64/solaris/socksys.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/solaris/socksys.c	2004-02-11 23:08:27.000000000 -0800
@@ -35,9 +35,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/arch/sparc64/solaris/timod.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc64/solaris/timod.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/sparc/kernel/sunos_ioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc/kernel/sunos_ioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/sparc/kernel/sys_sunos.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/sparc/kernel/sys_sunos.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
 
@@ -1050,13 +1051,9 @@ 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)
diff -puN arch/x86_64/ia32/ia32_ioctl.c~add-syscalls_h arch/x86_64/ia32/ia32_ioctl.c
--- 25/arch/x86_64/ia32/ia32_ioctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/x86_64/ia32/ia32_ioctl.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/arch/x86_64/ia32/sys_ia32.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/x86_64/ia32/sys_ia32.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -236,8 +237,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)
 {
@@ -734,9 +733,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 +874,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 +930,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)
 {
@@ -1165,12 +1153,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 +1169,6 @@ sys32_pwrite(unsigned int fd, char *ubuf
 }
 
 
-extern asmlinkage long sys_personality(unsigned long);
-
 asmlinkage long
 sys32_personality(unsigned long personality)
 {
@@ -1202,9 +1182,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)
 {
@@ -1500,8 +1477,6 @@ 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);
diff -puN arch/x86_64/kernel/x8664_ksyms.c~add-syscalls_h arch/x86_64/kernel/x8664_ksyms.c
--- 25/arch/x86_64/kernel/x8664_ksyms.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/x8664_ksyms.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/drivers/macintosh/via-pmu.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/drivers/macintosh/via-pmu.c	2004-02-11 23:08:27.000000000 -0800
@@ -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>
@@ -2344,8 +2345,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/fs/compat.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/fs/compat.c	2004-02-11 23:08:27.000000000 -0800
@@ -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/include/asm-alpha/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-alpha/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -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,14 +590,11 @@ 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);
diff -puN include/asm-arm26/unistd.h~add-syscalls_h include/asm-arm26/unistd.h
--- 25/include/asm-arm26/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-arm26/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -14,6 +14,7 @@
 #define __ASM_ARM_UNISTD_H
 
 #include <linux/linkage.h>
+#include <linux/syscalls.h>
 
 #define __NR_SYSCALL_BASE	0x900000
 
@@ -388,61 +389,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 +444,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)
diff -puN include/asm-arm/unistd.h~add-syscalls_h include/asm-arm/unistd.h
--- 25/include/asm-arm/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-arm/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -14,6 +14,7 @@
 #define __ASM_ARM_UNISTD_H
 
 #include <linux/linkage.h>
+#include <linux/syscalls.h>
 
 #if defined(__thumb__)
 #define __NR_SYSCALL_BASE	0
@@ -455,49 +456,41 @@ asmlinkage long sys_wait4(pid_t pid,unsi
 
 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);
 }
 
diff -puN include/asm-i386/unistd.h~add-syscalls_h include/asm-i386/unistd.h
--- 25/include/asm-i386/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-i386/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -398,6 +398,7 @@ 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);
 #endif
 
 /*
diff -puN include/asm-ia64/unistd.h~add-syscalls_h include/asm-ia64/unistd.h
--- 25/include/asm-ia64/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-ia64/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -263,39 +263,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 +300,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 +313,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);
 }
 
@@ -337,6 +326,11 @@ waitpid (int pid, int * wait_stat, int f
 extern int execve (const char *filename, char *const av[], char *const ep[]);
 extern pid_t clone (unsigned long flags, void *sp);
 
+extern asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				int prot, int flags,
+				int fd, long off);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-mips/unistd.h~add-syscalls_h include/asm-mips/unistd.h
--- 25/include/asm-mips/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-mips/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -1077,6 +1077,11 @@ static inline pid_t waitpid(int pid, int
 	return wait4(pid, wait_stat, flags, NULL);
 }
 
+extern asmlinkage unsigned long sys_mmap(
+				unsigned long addr, size_t len,
+				int prot, int flags,
+				int fd, off_t offset);
+
 #endif /* __KERNEL_SYSCALLS__ */
 #endif /* !__ASSEMBLY__ */
 
diff -puN include/asm-parisc/unistd.h~add-syscalls_h include/asm-parisc/unistd.h
--- 25/include/asm-parisc/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-parisc/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -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,28 @@ 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);
 }
 
+extern asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long offset);
+
 #endif	/* __KERNEL_SYSCALLS__ */
 
 #endif /* __ASSEMBLY__ */
diff -puN include/asm-ppc64/unistd.h~add-syscalls_h include/asm-ppc64/unistd.h
--- 25/include/asm-ppc64/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-ppc64/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -405,6 +405,10 @@ 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);
 
+extern unsigned long sys_mmap(unsigned long addr, size_t len,
+			      unsigned long prot, unsigned long flags,
+			      unsigned long fd, off_t offset);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-ppc/unistd.h~add-syscalls_h include/asm-ppc/unistd.h
--- 25/include/asm-ppc/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-ppc/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -390,6 +390,10 @@ 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);
 
+extern unsigned long sys_mmap(unsigned long addr, size_t len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, off_t offset);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-s390/unistd.h~add-syscalls_h include/asm-s390/unistd.h
--- 25/include/asm-s390/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-s390/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -506,6 +506,7 @@ type name(type1 arg1, type2 arg2, type3 
 #ifdef __KERNEL_SYSCALLS__
 
 #include <asm/stat.h>
+#include <linux/syscalls.h>
 
 /*
  * we need this inline - forking from kernel space will result
@@ -531,8 +532,6 @@ 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);
diff -puN include/asm-sparc64/unistd.h~add-syscalls_h include/asm-sparc64/unistd.h
--- 25/include/asm-sparc64/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-sparc64/unistd.h	2004-02-11 23:08:27.000000000 -0800
@@ -440,6 +440,11 @@ 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)
 
+extern asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long off);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 #ifdef __KERNEL__
diff -puN include/asm-sparc/unistd.h~add-syscalls_h include/asm-sparc/unistd.h
--- 25/include/asm-sparc/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-sparc/unistd.h	2004-02-11 23:08:28.000000000 -0800
@@ -450,6 +450,11 @@ 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)
 
+extern asmlinkage unsigned long sys_mmap(
+				unsigned long addr, unsigned long len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, unsigned long off);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 /*
diff -puN include/asm-um/unistd.h~add-syscalls_h include/asm-um/unistd.h
--- 25/include/asm-um/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-um/unistd.h	2004-02-11 23:08:28.000000000 -0800
@@ -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__
 
diff -puN include/asm-v850/unistd.h~add-syscalls_h include/asm-v850/unistd.h
--- 25/include/asm-v850/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-v850/unistd.h	2004-02-11 23:08:28.000000000 -0800
@@ -417,6 +417,10 @@ extern inline pid_t wait(int * wait_stat
 	return waitpid (-1, wait_stat, 0);
 }
 
+extern unsigned long sys_mmap(unsigned long addr, size_t len,
+				unsigned long prot, unsigned long flags,
+				unsigned long fd, off_t offset);
+
 #endif
 
 /*
diff -puN include/asm-x86_64/unistd.h~add-syscalls_h include/asm-x86_64/unistd.h
--- 25/include/asm-x86_64/unistd.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/asm-x86_64/unistd.h	2004-02-11 23:08:28.000000000 -0800
@@ -553,6 +553,8 @@ do { \
 
 #ifndef __KERNEL_SYSCALLS__
 
+#include <linux/syscalls.h>
+
 #define __syscall "syscall"
 
 #define _syscall0(type,name) \
@@ -650,31 +652,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,32 +680,32 @@ 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)
+static 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);
+
 #endif /* __KERNEL_SYSCALLS__ */
 
 #endif /* __NO_STUBS */
diff -puN /dev/null include/linux/syscalls.h
--- /dev/null	2002-08-30 16:31:37.000000000 -0700
+++ 25-akpm/include/linux/syscalls.h	2004-02-11 23:08:28.000000000 -0800
@@ -0,0 +1,458 @@
+/*
+ * 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 compat_timespec;
+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 msghdr;
+struct new_utsname;
+struct nfsctl_arg;
+struct __old_kernel_stat;
+struct pollfd;
+struct rlimit;
+struct rusage;
+struct sched_param;
+struct semaphore;
+struct sockaddr;
+struct stat;
+struct stat64;
+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 <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);
+#if !defined(__alpha__) && !defined(__ia64__)
+asmlinkage unsigned long sys_alarm(unsigned int seconds);
+#endif
+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 *);
+asmlinkage long sys_sigprocmask(int, old_sigset_t *, old_sigset_t *);
+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);
+
+#ifndef __alpha__
+asmlinkage long sys_nice(int increment);
+#endif
+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_reboot(int magic1, int magic2, unsigned int cmd,
+				void __user *arg);
+
+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);
+#if !defined(__alpha__) && !defined(__ia64__) && !defined(__arm__)
+asmlinkage long sys_waitpid(pid_t pid, unsigned int *stat_addr, int options);
+#endif
+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);
+#ifdef CONFIG_FUTEX
+asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
+			struct compat_timespec *utime, u32 *uaddr2);
+#endif
+
+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_restart_syscall(void);
+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_sigpending(old_sigset_t __user *set);
+#if !defined(__alpha__)
+asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
+				old_sigset_t __user *oset);
+#endif
+#ifndef __sparc__
+asmlinkage long sys_rt_sigaction(int sig,
+				const struct sigaction __user *act,
+				struct sigaction __user *oact,
+				size_t sigsetsize);
+#endif
+#if !defined(__alpha__) && !defined(__ia64__) && !defined(__arm__)
+asmlinkage long sys_sgetmask(void);
+asmlinkage long sys_ssetmask(int newmask);
+#endif
+#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) && \
+    !defined(__arm__)
+asmlinkage unsigned long
+sys_signal(int sig, __sighandler_t handler);
+#endif
+#ifndef HAVE_ARCH_SYS_PAUSE
+asmlinkage long sys_pause(void);
+#endif
+
+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_pivot_root(const char __user *new_root,
+				const char __user *put_old);
+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_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 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);
+asmlinkage long sys_munmap(unsigned long addr, size_t len);
+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_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);
+#if !defined(__alpha__)
+asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
+			unsigned long offset_low, loff_t __user *result,
+			unsigned int origin);
+#endif
+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,
+				void *optval, int *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 int 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_shutdown(int, int);
+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_prctl(int option, unsigned long arg2, unsigned long arg3,
+			unsigned long arg4, unsigned long arg5);
+
+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_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/include/linux/sysctl.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/include/linux/sysctl.h	2004-02-11 23:08:28.000000000 -0800
@@ -721,7 +721,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/init/do_mounts_devfs.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/init/do_mounts_devfs.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/init/do_mounts.h~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/init/do_mounts.h	2004-02-11 23:08:28.000000000 -0800
@@ -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/init/initramfs.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/init/initramfs.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/kernel/compat.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/compat.c	2004-02-11 23:08:28.000000000 -0800
@@ -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)
 {
@@ -381,9 +378,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 +399,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 +440,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 +472,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 +486,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 +500,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 +514,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/kernel/panic.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/panic.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/kernel/power/disk.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/power/disk.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/kernel/power/swsusp.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/power/swsusp.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/kernel/sysctl.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/sysctl.c	2004-02-11 23:08:28.000000000 -0800
@@ -2028,7 +2028,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/kernel/uid16.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/kernel/uid16.c	2004-02-11 23:08:28.000000000 -0800
@@ -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/net/compat.c~add-syscalls_h	2004-02-11 23:08:27.000000000 -0800
+++ 25-akpm/net/compat.c	2004-02-11 23:08:28.000000000 -0800
@@ -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);

_