diff -Naur -X exclude-files ac_clean/arch/um/kernel/sys_call_table.c ac/arch/um/kernel/sys_call_table.c --- ac_clean/arch/um/kernel/sys_call_table.c Sun May 27 20:18:41 2001 +++ ac/arch/um/kernel/sys_call_table.c Sun May 27 20:04:38 2001 @@ -26,7 +26,6 @@ extern syscall_handler_t sys_stat; extern syscall_handler_t sys_lseek; extern syscall_handler_t sys_getpid; -extern syscall_handler_t sys_mount; extern syscall_handler_t sys_oldumount; extern syscall_handler_t sys_setuid16; extern syscall_handler_t sys_getuid16; @@ -70,7 +69,6 @@ extern syscall_handler_t sys_dup2; extern syscall_handler_t sys_getppid; extern syscall_handler_t sys_getpgrp; -extern syscall_handler_t sys_setsid; extern syscall_handler_t sys_sigaction; extern syscall_handler_t sys_sgetmask; extern syscall_handler_t sys_ssetmask; @@ -118,7 +116,6 @@ extern syscall_handler_t sys_vhangup; extern syscall_handler_t sys_ni_syscall; extern syscall_handler_t sys_ni_syscall; -extern syscall_handler_t sys_wait4; extern syscall_handler_t sys_swapoff; extern syscall_handler_t sys_sysinfo; extern syscall_handler_t sys_ipc; @@ -146,7 +143,6 @@ extern syscall_handler_t sys_setfsgid16; extern syscall_handler_t sys_llseek; extern syscall_handler_t sys_getdents; -extern syscall_handler_t sys_select; extern syscall_handler_t sys_flock; extern syscall_handler_t sys_msync; extern syscall_handler_t sys_readv; @@ -300,7 +296,7 @@ [ __NR_dup2 ] = sys_dup2, [ __NR_getppid ] = sys_getppid, [ __NR_getpgrp ] = sys_getpgrp, - [ __NR_setsid ] = sys_setsid, + [ __NR_setsid ] = (syscall_handler_t *) sys_setsid, [ __NR_sigaction ] = sys_sigaction, [ __NR_sgetmask ] = sys_sgetmask, [ __NR_ssetmask ] = sys_ssetmask, @@ -347,7 +343,7 @@ [ __NR_iopl ] = sys_ni_syscall, [ __NR_vhangup ] = sys_vhangup, [ __NR_idle ] = sys_ni_syscall, - [ __NR_wait4 ] = sys_wait4, + [ __NR_wait4 ] = (syscall_handler_t *) sys_wait4, [ __NR_swapoff ] = sys_swapoff, [ __NR_sysinfo ] = sys_sysinfo, [ __NR_ipc ] = sys_ipc, @@ -374,7 +370,7 @@ [ __NR_setfsgid ] = sys_setfsgid16, [ __NR__llseek ] = sys_llseek, [ __NR_getdents ] = sys_getdents, - [ __NR__newselect ] = sys_select, + [ __NR__newselect ] = (syscall_handler_t *) sys_select, [ __NR_flock ] = sys_flock, [ __NR_msync ] = sys_msync, [ __NR_readv ] = sys_readv, @@ -430,7 +426,7 @@ [ __NR_stat64 ] = sys_stat64, [ __NR_lstat64 ] = sys_lstat64, [ __NR_fstat64 ] = sys_fstat64, - ARCH_SYSCALLS, + ARCH_SYSCALLS [ LAST_SYSCALL + 1 ... NR_syscalls ] = (syscall_handler_t *) sys_ni_syscall }; diff -Naur -X exclude-files ac_clean/include/asm-um/unistd.h ac/include/asm-um/unistd.h --- ac_clean/include/asm-um/unistd.h Sun May 27 20:19:00 2001 +++ ac/include/asm-um/unistd.h Sun May 27 20:07:11 2001 @@ -1,58 +1,100 @@ +/* + * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + #ifndef _UM_UNISTD_H_ #define _UM_UNISTD_H_ -#include "linux/types.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 void start_kernel(void); -extern int idle(void); -extern int um_execve(char *file, char **argv, char **env); -#define execve(file, argv, env) um_execve(file, argv, env) +#ifdef __KERNEL_SYSCALLS__ -extern long sys_open(const char *file, int flags, int mode); +#define KERNEL_CALL(ret_t, sys, args...) \ + mm_segment_t fs = get_fs(); \ + ret_t ret; \ + set_fs(KERNEL_DS); \ + ret = sys(args); \ + set_fs(fs); \ + return ret; -static inline long open(const char *file, int flags, int mode) +extern inline long open(const char *pathname, int flags, int mode) { - return(sys_open(file, flags, mode)); + KERNEL_CALL(int, sys_open, pathname, flags, mode) } -extern int sys_dup(unsigned int fd); - -static inline long dup(unsigned int fd) +extern inline long dup(unsigned int fd) { - return(sys_dup(fd)); + KERNEL_CALL(int, sys_dup, fd); } -extern long sys_close(unsigned int fd); +extern inline long close(unsigned int fd) +{ + KERNEL_CALL(int, sys_close, fd); +} -static inline long um_close(unsigned int fd) +extern inline int execve(const char *filename, char *const argv[], + char *const envp[]) { - return(sys_close(fd)); + return um_execve(filename, argv, envp); } -#define close(fd) um_close(fd) +extern inline long waitpid(pid_t pid, unsigned int *status, int options) +{ + KERNEL_CALL(pid_t, sys_wait4, pid, status, options, NULL) +} -extern long sys_waitpid(pid_t pid, unsigned int * stat_addr, int options); +extern inline pid_t wait(int *status) +{ + KERNEL_CALL(pid_t, sys_wait4, -1, status, 0, NULL) +} -static inline long waitpid(pid_t pid, unsigned int * stat_addr, int options) +extern inline pid_t setsid(void) { - return(sys_waitpid(pid, stat_addr, options)); + KERNEL_CALL(pid_t, sys_setsid) } +#endif + +/* Save the value of __KERNEL_SYSCALLS__, undefine it, include the underlying + * arch's unistd.h for the system call numbers, and restore the old + * __KERNEL_SYSCALLS__. + */ + #ifdef __KERNEL_SYSCALLS__ #define __SAVE_KERNEL_SYSCALLS__ __KERNEL_SYSCALLS__ #endif #undef __KERNEL_SYSCALLS__ - #include "asm/arch/unistd.h" -static inline pid_t wait(int * wait_stat) -{ - return waitpid(-1,wait_stat,0); -} - -#ifdef __SAVE_KERNEL_SYSCALLS__ +#ifdef __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__ __SAVE_KERNEL_SYSCALLS__ #endif #endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */