SysCall KERNEL 2.2.X && 2.4.X ----------------------------- syscall-no. in eax, arguments left to right in regs ebx, ecx, edx, esi, edi(,ebp). returned 0xfffff000 < eax <= 0xffffffff may be an error code (-4096 < eax < 0). 1 EXIT terminate current process arg: eax 1 ebx exit code return: eax -/- errors: eax -/- source: kernel/exit.c ----------------- 2 FORK struct pt_regs create a child process resource resource utilizations:=0, file locks & pending signals not inherited. simplified "clone" w/ flags set to SIGCHLD and caller's ESP arg eax 2 ebx ...all register values passed to duplicate job return eax clone: zero caller: pid_t pid (dword) or, -ve error code errors EAGAIN, ENOMEM ref linux/sched.h, asm/ptrace.h source arch/i386/kernel/process.c struct pt_regs { long ebx; long ecx; long edx; long esi; long edi; long ebp; long eax; int xds; int xes; longorig_eax; long eip; int xcs; long eflags; long esp; int xss; }; ----------------- 3 READ int fd, void *buf, size_t count read up to count bytes from file fd into buffer *buf arg eax 3 ebx file descriptor ecx ptr to input buffer edx buffer size, max. count of bytes to receive return eax no. of bytes received, file pointer advanced accordingly errors eax EAGAIN, EBADF, EFAULT, EINTR, EINVAL, EIO, EISDIR note that "buffer overflow" is not immanent to the system call but, was introduced by ignorant "programming" rsp (lib)"C" useage/design... source fs/read_write.c ----------------- 4 WRITE int fd, void *buf, size_t count, write (up to) count bytes of data from *buf to file fd arg eax 4 ebx file descriptor ecx ptr to output buffer edx count of bytes to send return eax no. of sent bytes (if POSIX conforming f.s.) errors eax EAGAIN, EBADF, EFAULT, EINTR, EINVAL, EIO, ENOSPC, EPIPE source fs/read_write.c ----------------- 5 OPEN const char *pathname, int flags, mode_t mode open a file or device, create/truncate if corresponding mode flag(s) set arg eax 5 ebx ptr to asciz abs or rel pathname ecx file access bits edx file permissions, mode return eax int fd (16bit filedescriptor) errors eax ACCESS, EXIST, FAULT, ISDIR, LOOP, MFILE, NAMETOOLONG, NFILE, NOENT, NODEV, NODIR, NOMEM, NOSPC, NXIO, ROFS, TXTBSY ref linux/types.h, linux/posix_types.h, linux/stat.h -re- struct stat, asm/fcntl.h, asm/types.h, asm/posix_types.h, fcntl.h, sys/stat.h, sys/types.h source fs/open.c file access bits O_ACCMODE 0003 O_RDONLY 00 O_WRONLY 01 O_RDWR 02 O_CREAT 0100 O_EXCL 0200 O_NOCTTY 0400 O_TRUNC 01000 O_APPEND 02000 O_NONBLOCK 04000 O_NDELAY O_NONBLOCK O_SYNC 010000 specific to ext2 fs and block devices FASYNC 020000 fcntl, for BSD compatibility O_DIRECT 040000 direct disk access hint - currently ignored O_LARGEFILE 0100000 O_DIRECTORY 0200000 must be a directory O_NOFOLLOW 0400000 don't follow links file permissions flags S_ISUID 04000 set user ID on execution S_ISGID 02000 set group ID on execution S_ISVTX 01000 sticky bit S_IRUSR 00400 read by owner (S_IREAD) S_IWUSR 00200 write by owner (S_IWRITE) S_IXUSR 00100 execute/search by owner (S_IEXEC) S_IRGRP 00040 read by group S_IWGRP 00020 write by group S_IXGRP 00010 execute/search by group S_IROTH 00004 read by others S_IWOTH 00002 write by others S_IXOTH 00001 execute/search by others ----------------- 6 CLOSE int fd close a file by fd reference arg eax 6 ebx file descriptor return eax -/- errors eax EBADF (-1) source fs/open.c ----------------- 7 WAITPID pid_t pid, int *status, int options wait for a specified child process termination; simplified call to wait4 arg eax 7 ebx 2nd-ary process id or specification ecx NULL or, ptr to buf for exitted 2nd-ary job status edx option flags, zero or WNOHANG, WUNTRACED return eax pid_t, pid of 2ndary job which exitted ecx if buffer supplied, exit state of 2nd-ary job errors eax CHILD, INVAL, RESTARTSYS ref libc: sys/wait.h, wait.c &c source kernel/exit.c exit state: pid signal sent to -------- | ------------------------------------------- > 0 process {pid} 0 every process in caller's process group -1 all processes but the very first <-1 every process in group |{gid}| ("killpg", getgid) ----------------- 8 REAT const char *pathname mode_t mode create a file arg eax 8 ebx ptr to asciz abs or rel pathname ecx file permissions, mode return eax int fd filedescriptor errors eax access, exist, fault, isdir, loop, mfile, nametoolong nfile, noent, nodev, nodir, nomem, nospc, nxio rofs, txtbsy ref sys/stat.h, fcntl.h source fs/open.c ----------------- 9 LINK const char *oldpath const char *newpath create hard link to an existing file arg eax 9 ebx ptr to asciz abs or rel name of existing file ecx ptr to asciz abs or rel name of new file-name return eax -/- errors eax acces, io, perm, exist, fault, loop mlink, nametoolong, noent, nomem, nospc, notdir, perm, rofs, xdev ref -/- source fs/namei.c ----------------- 10 UNLINK const char *pathname delete a name and remove file when not busy arg eax 10 ebx ptr to asciz abs or rel file-name return eax -/- errors eax acces, fault, io, isdir, loop, nametoolong, noent, nomem, notdir, perm, rofs ref -/- source fs/namei.c ----------------- 11 EXECVE const char *filename, char const argv[], char const envp[] execute a program arg eax 11 ebx ptr to terminated string of program path&name ecx ptr to zero terminated list of ptrs to terminated program argument stgs edx ptr to zero terminated list of ptrs to terminated environment strings return no return, executed prog inherits resources and overwrites caller errors eax 2big, acces, inval, io, isdir, libbad loop, nfile, noexec, noent, nomem, notdir, fault, nametoolong, perm, txtbusy ref arch/i386/kernel/process.c note waiting caller of a "fork"ed or "clone"d job being released immediately after entry to execve. ----------------- 12 CHDIR const char *path change working directory arg eax 12 ebx ptr to asciz abs or rel file-name return eax -/- errors eax acces, badf, fault, io, loop, nametoolong, noent, nomem, notdir ref -/- source fs/open.c ----------------- 13 TIME time_t *t get time in seconds since 1-jan-1970 arg eax 13 ebx NULL or, ptr to buffer which receives a copy of the return value return eax ((time_t)-1) seconds errors eax fault ref linux/time.h source kernel/time.c long int __time_t; ----------------- 14 MKNOD const char *pathname, mode_t mode, dev_t dev create a filesystem node (file, device, special file, named pipe) return -/- errors acces, exist, fault, inval, loop, nametoolong, noent, nomem, nospc, notdir, perm, rofs ref sys/stat.h (mode flags), fcntl.h source fs/namei.c ----------------- 15 CHMOD const char *path, mode_t mode change file permissions (attributes) return -/- errors acces, badf, fault, io, loop, nametoolong, noent, nomem, notdir, perm, rofs ref [types], sys/stat.h, asm/stat.h source fs/open.c file access bits O_ACCMODE 0003 O_RDONLY 00 O_WRONLY 01 O_RDWR 02 O_CREAT 0100 O_EXCL 0200 O_NOCTTY 0400 O_TRUNC 01000 O_APPEND 02000 O_NONBLOCK 04000 O_NDELAY O_NONBLOCK O_SYNC 010000 specific to ext2 fs and block devices FASYNC 020000 fcntl, for BSD compatibility O_DIRECT 040000 direct disk access hint - currently ignored O_LARGEFILE 0100000 O_DIRECTORY 0200000 must be a directory O_NOFOLLOW 0400000 don't follow links ----------------- 16 LCHOWN const char *path,uid_t owner,gid_t group change owner of a file, don't follow symbolic links return -/- errors (many...) source fs/open.c ----------------- 17 break (n.i.) ----------------- 18 oldstat (not existing any more) ----------------- 19 LSEEK int fd, off_t offset, int whence change posn. ptr of filedescriptor return off_t ptr posn. re beginning of file errors badf, inval, ispipe ref unistd.h, linux/unistd.h source fs/read_write.c ----------------- 20 GETPID void get pid of current process return pid_t pid errors -/- source kernel/sched.c ----------------- 21 MOUNT const char *specialfile, const char *dir, const char fstype, usigned long rwflag, const void *data mount a filesystem return -/- errors any which can occur in the particular f.s. or, in the kernel ref sys/mount.h linux/mount.h source fs/super.c ----------------- 22 UMOUNT const char *specialfile | *dir unmount a filesystem return -/- errors any which can occur in the particular f.s. or, in the kernel ref sys/mount.h, /proc/filesystems source fs/super.c ----------------- 23 SETUID uid_t uid set real user id return -/- errors eperm source kernel/sys.c ----------------- 24 GETUID void get real user id return uid_t uid errors -/- ref unistd.h, linux/unistd.h source kernel/sched.c ----------------- 25 STIME time_t *t set secinds since 1-jan-1970 return -/- errors eperm ref time.h source kernel/time.c ----------------- 26 PTRACE enum __ptrace_request request, pid_t pid, void addr, void *data trace a child process arg eax 26 ebx requested action ecx process id of the target job "child" edx address in target job "address" esi address in tracing job "data" return eax as specified by the request errors io, fault, perm, srch ref linux/ptrace.h. asm/ptrace.h, linux/sched.h. asm/user.h, source arch/i386/kernel/ptrace.c request 16 PTRACE_ATTACH: attach to already running process 7 PTRACE_CONT: restart after signal. 17 PTRACE_DETACH: detach a process that was attached. 14 PTRACE_GETFPREGS: get the child FPU state. register struct. 12 PTRACE_GETREGS: get all gp regs from the child. 8 PTRACE_KILL: make the child exit, send it a sigkill. 1 PTRACE_PEEKTEXT: read word at location addr. 2 PTRACE_PEEKDATA: read the word at location addr in the USER area. 3 PTRACE_PEEKUSR: " 4 PTRACE_POKETEXT: write the word at location addr. 5 PTRACE_POKEDATA: " 6 PTRACE_POKEUSR: write the word at location addr in the USER area 13 PTRACE_SETREGS: set all gp regs in the child. 15 PTRACE_SETFPREGS: set the child FPU state. 9 PTRACE_SINGLESTEP: set the trap flag. 24 PTRACE_SYSCALL: continue and stop at next (return from) syscall 0 PTRACE_TRACEME: set the ptrace bit in the process flags. struct user_i387_struct { long cwd; long swd; long twd; long fip; long fcs; long foo; long fos; long st_space[20]; // 8*10 bytes for each FP-reg = 80 bytes }; struct user_regs_struct { long ebx, ecx, edx, esi, edi, ebp, eax; unsigned short ds, __ds, es, __es; unsigned short fs, __fs, gs, __gs; long orig_eax, eip; unsigned short cs, __cs; long eflags, esp; unsigned short ss, __ss; }; ----------------- 27 ALARM unsigned int seconds send SIGALARM at a specified time return 0 or unsigned int seconds until prev. alarms are due to execute errors -/- source kernel/sched.c ----------------- 28 OLDFSTAT (non existing any more) source fs/stat.c ----------------- 29 PAUSE void sleep until signal return -1 and restartnohand errors intr source kernel/sched.c ----------------- 30 UTIME char *filename, struct utimbuf *buf change access and/or modification time of an inode return -/- errors acces, noent ref sys/time.h, utime.h source fs/open.c ----------------- 31 STTY (n.i.) ----------------- 32 GTTY (n.i.) ----------------- 33 ACCESS const char *pathname, int mode check user's permissions for a file return -/- errors all f.s. and file access related errors can occur source fs/open.c ----------------- 34 NICE int inc change process priority return -/- errors perm source kernel/sched.c ----------------- 35 FTIME (n.i.) ----------------- 36 SYNC void commit buffer cache to disk return always 0 errors -/- source fs/buffer.c ----------------- 37 KILL pid_t pid, int sig send a signal to a process return -/- errors inval, perm, srch ref kernel/sys.c source kernel/signal.c pid signal sent to -------- | ------------------------------------------- > 0 process {pid} 0 every process in caller's process group -1 all processes but the very first <-1 every process in group |{gid}| ("killpg", getgid) no action if sig = 0, but error checking occurs, i.e. this can be used to check whether a process exists. ----------------- 38 RENAME const char *oldpath, const char *newpath move/rename a file return -/- errors busy, exist, isdir, notempty, xdev (and other f.s. errors) ref stdio.h source fs/namei.c ----------------- 39 MKDIR const char *path, mode_t mode create a directory return -/- errors (f.s. & perm's related errors) ref sys/stat.h, fcntl.h, unistd.h, linux/unistd.h source fs/namei.c ----------------- 40 RMDIR const char *pathname delete an empty directory return -/- errors access, busy, fault, loop, nametoolong, noent, nomem, notdir, notempty, perm, rofs source fs/namei.c ----------------- 41 DUP int oldfd create a file descriptor duplicate return int new fd errors badf, mfile (,inval) source fs/fcntl.c ----------------- 42 PIPE int fd[2] create a pipe return -/- errors fault, mfile, nfile source arch/i386/kernel/sys_i386.c note: re mknod for named pipes. ----------------- 43 TIMES struct tms *buf get process times return -/- errors -/- ref sys/times.h source kernel/sys.c struct tms { clock_t tms_utime; // re __kernel_clock_t clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime; }; ----------------- 44 PROF (n.i.) ----------------- 45 BRK void *end_data_segment change data section size, top of .bss arg ebx = (virtual) address of new .bss top, with the address not above 16K below .ss (stack) section and below any linked library. ebx = 0 can be used to finding the current mem-top. return eax currently (after call) valid top address errors nomem source mm/mmap.c ----------------- 46 SETGID gid_t gid set real group id of current process return -/- errors perm source kernel/sys.c ----------------- 47 GETGID void get real group id of current process return gid_t gid errors -/- ref unistd.h, linux/unistd.h source kernel/sched.c ----------------- 48 SIGNAL *signal(int signum, void (*handler)(int)) setup a signal handler return void previous value of signal hnd errors sig_err source kernel/signal.c ----------------- 49 GETEUID void get effective user id of current process return uid_t uid errors -/- ref unistd.h, linux/unistd.h source kernel/sched.c ----------------- 50 GETEGID void get effective group id of current process return gid_t gid errors -/- ref unistd.h, linux/unistd.h source kernel/sched.c ----------------- 51 ACCT int acct(const char *filename) switch process accounting on/off return 0 or -ve ernum errors nosys, nomem, perm, access, io, users source kernel/sys.c ----------------- 52 UMOUNT2 (no manual entry) source fs/super.c ----------------- 53 LOCK (n.i.) ----------------- 54 IOCTL int d, int request, char *argp manipulate a character device return -/- errors badf, fault, inval, notty ref asm/ioctl.h source fs/ioctl.c ----------------- 55 FCNTL int fd, int cmd [ struct flock *lock ] file/-descriptor control return according to operation errors acces, again, badf, deadlk, fault, intr, inval, mfilem nolock, perm ref unistd.h, linux/unistd.h, fcntl.h source fs/fcntl.c ----------------- 56 MPX (n.i.) ----------------- 57 SETPGID pid_t pid, pid_t pgid set process group id return -/- errors inval, perm, srch source kernel/sys.c ----------------- 58 ULIMIT int cmd, (...) get/set resource limits - not a system call ref syscalls setrlimit, getrlimit ref(glibc2) man (3) ulimit, sysdeps/generic/ulimit.c, sysdeps/unix/sysv/linux/ulimit.c ----------------- 59 OLDOLDUNAME (syscall does not exist any more) ----------------- 60 UMASK mode_t mask set file creation mask return mode_t previous value of mask errors -/- ref sys/stat.h source kernel/sys.c ----------------- 61 CHROOT const char *path change root directory (tree) return -/- errors any, dependent on f.s. type source fs/open.c ----------------- 62 USTAT (n.i.) source fs/super.c ----------------- 63 DUP2 int oldfd, int newfd duplicate file descriptor oldfd, on success replace newfd w/ duplicated. return int newfd errors badf, mfile source fs/fcntl.c ----------------- 64 GETPPID void get parent process id return pid_t pid errors -/- source kernel/sched.c ----------------- 65 GETPGRP void get group id of parent of current process return pid_t gid errors inval,perm, srch ----------------- 66 SETSID void create session, set group id return pid_t gid errors perm ----------------- 67 SIGACTION int signum, const struct old_sigaction *act, struct old_sigaction *oldact set/get signal handler, signum re man 7 signal return -/- errors fault, intr, inval ref signal.h, asm/signal.h, include/signal.h struct old_sigaction { __sighandler_t sa_handler; old_sigset_t sa_mask; unsigned long sa_flags; void (*sa_restorer)(void); }; struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; void (*sa_restorer)(void); sigset_t sa_mask; // mask last for extendability }; ----------------- 68 SGETMASK void (*sighandler)(int) library function, signal & siggetmask ----------------- 69 SSETMASK signal,&sigsetmask ----------------- 70 SETREUID uid_t ruid, uid_t euid set real and effective user id return -/- errors perm ----------------- 71 SETREGID gid_t rgid, gid_t egid set real and effective group id return -/- errors perm ----------------- 72 SIGSUSPEND replacement for sigpause, re sigaction ----------------- 73 SIGPENDING get pending, but blocking signals ----------------- 74 SETHOSTNAME const char *name, size_t len set system's hostname return -/- errors fault, inval, perm ----------------- 75 SETRLIMIT int resource, const struct rlimit *rlim set resource limit return -/- errors fault, inval, perm ref linux/time.h, sys/time.h, sys/resource.h, unistd.h ----------------- 76 GETRLIMIT int resource, struct rlimit *rlim get resource limits return -/- errors fault, inval, perm refs include/linux/time.h, include/linux/resource.h, include/asm/resource.h ----------------- 77 GETRUSAGE int who, struct rusage *usage get resource useage return -/- errors fault, inval, perm ref include/linux/time.h, include/linux/resource.h, ----------------- 78 GETTIMEOFDAY struct timeval *tv, struct timezone *tz get timezone & seconds since 1-jan-1970 ("the epoch") arg eax 78 ebx ptr to writable timeval struct ecx ptr to writable timezone struct return result written to supplied data structures errors eax fault, inval, perm ref sys/time.h, include/linux/time.h note that is not a reliable item: man 2 (falsely) stating "tz_dsttime" item of struct timezone not being used and, that any such usage in the kernel be a "bug" - which is probably just plain nonsense: re kernel source (fat, hfs, hpfs, isofs)... struct timeval { time_t tv_sec; // dword, seconds suseconds_t tv_usec; // dword, microseconds }; struct timezone { int tz_minuteswest; // minutes west of Greenwich int tz_dsttime; // type of dst correction }; ----------------- 79 SETTIMEOFDAY const struct timeval *tv, const struct timezone *tz set timezone & seconds since 1-jan-1970 arg eax 79 ebx ptr to timeval struct ecx ptr to timezone struct return -/- errors eax fault, inval, perm ref sys/time.h, include/linux/time.h, gettimeofday ----------------- 80 GETGROUPS int size, gid_t list[] get supplemental groups return no. of supplementary groups errors fault, inval, perm ----------------- 81 SETGROUPS size_t size, const gid_t *list set supplemental groups return -/- errors fault, inval, perm ----------------- 82 select K4:oldselect int n, fd_set *rfds, fdset *wfds, struct timeval *t re newselect K4:select suspend until action of a filedescriptor, synchronous i/o mux. return no. of zero descriptors before timeout errors intr, inval, nomem ref sys/time.h, sys/types.h, unistd.h source sys_i386.c ----------------- 83 SYMLINK const char *oldpath, const char *newpath create symbolic link to a file return -/- errors (files & permissions errors) ----------------- 84 OLDLSTAT (not existing any more) return errors ----------------- 85 READLINK const char *path, char *buf, size_t bufsize read value of a symbolic link return no. of bytes read errors (fs & permissions errors) ----------------- 86 USELIB const char *library use a shared library return -/- errors acces, noexec, (memory errors as from mmap) ----------------- 87 SWAPON start swapping to a file/device return -/- errors inval, noent, nomem, perm (etc) ref unistd.h, asm/page.h, sys/swap.h, linux/swap.h source mm/swapfile.c ----------------- 88 REBOOT int magic, int magic2, int flag, int void *arg reboot or en-/disable CTR/ALT/DEL return -/- errors inval, perm ref unistd.h,linux/reboot.h ----------------- 89 READDIR int readdir, uint fd, struct dirent *dirp, uint count read directory return -/- errors badf, fault, inval, noent, notdir ref unistd.h, linux dirent.h, linux/unistd.h ----------------- 90 MMAP map a file or device into memory arg ebx address of args struct: void *start (dword, preferred memory address or, NULL) size_t length(dword, file size) int prot (dword, PROT_READ / WRITE / EXEC) int flags (dword, MAP_SHARED / PRIVATE / FIXED) int fd (dword, Linux file descriptor) off_t offset return eax ptr to mapped area (may be -ve!) error eax 0 > eax > -4096: acces, again, badf, inval, nomem, txtbusy ref unistd.h, sys/mman.h, glibc: malloc/malloc.c source sys_i386.c note: "PROT"-flags enable the rsp. mode (i.e. UN-protect!) "PROT_NONE" disables all. ----------------- 91 MUNMAP void *start, size_t length unmap a file or device into memory return -/- errors acces, again, badf, inval, nomem, txtbusy ref unistd.h, sys/mman.h, glibc: malloc/malloc.c ----------------- 92 TRUNCATE const char *path, off_t length change file size to at most length bytes return -/- errors (file & access) ----------------- 93 FTRUNCATE int fd, off_t length change opened writable file size to at most length bytes return -/- errors (file & access) ----------------- 94 FCHMOD int fd, mode_t mode change permissions of an open writable file return -/- errors (file & access) ref sys/types.h, sys/stat.h, linux/stat.h -re- struct stat ----------------- 95 FCHOWN int fd, uid_t owner, gid_t group change owner of an open file return -/- errors (file & access) ----------------- 96 GETPRIORITY int which, int who get a process/group/users scheduling priority return int priority errors inval, srch ref sys/time.h, sys/resource.h ----------------- 97 SETPRIOTIY int which, int who, int prio set a process/group/users scheduling priority return -/- errors acces, inval, perm, srch ref sys/time.h, sys/resource.h ----------------- 98 PROFIL char *buf, int bufsiz, int offset, int scale execution time profile return 0 errors -/- ----------------- 99 STATFS const char *path, struct statfs *buf get filesystem status (statistics) return -/- errors (file & access) ref sys/vfs.h ----------------- 100 FSTATFS int fd, struct statfs *buf get opened filesystem status (statistics) return -/- errors (file & access) ref sys/vfs.h ----------------- 101 IOPERM unsigned long from, unsigned long num, int turn_on set selected i/o ports permissions return -/- errors (crash...) ref sys/io.h (glibc), unistd.h (libc5) ----------------- 102 SOCKETCALL int call, unsigned long *args socket call multiplexer - re ipc return (?) errors (?) ----------------- 103 SYSLOG int syslog, int type, const *bufp, int len manipulate system logging, read/clear kernel msg buf, set console loglevel return according to type errors inval, perm, restartsys ref unistd.h, sys/unistd.h, kernel/printk.c (type values) ----------------- 104 SETITIMER int which, const struct itimerval *value, struct itimerval *ovalue set interval timer return -/- errors fault, inval ref sys/time.h ----------------- 105 GETITIMER int which, struct itimerval *value set interval timer return -/- errors fault, inval ref sys/time.h ----------------- 106 STAT const char *file_name, struct stat *buf get file status return -/- errors acces, badf, fault, loop, nametoolong, noent, nomem, notdir ref sys/stat.h, unistd.h, linux/stat.h -re- struct stat struc stat ; size disp ; "CELL" == 'long' .st_dev: resw 1 ; SHORT 00 device, zero for PIPE .pad1: resw 1 ; SHORT .st_ino: resd 1 ; CELL 04 inode .st_mode: resw 1 ; SHORT 08 protection .st_nlink: resw 1 ; SHORT 0a number of hard links .st_uid: resw 1 ; SHORT 0c user ID of owner .st_gid: resw 1 ; SHORT 0e group ID of owner .st_rdev: resw 1 ; SHORT 10 device type (if inode device) .pad2: resw 1 ; SHORT .st_size: resd 1 ; CELL 14 total size, in bytes .st_blksize: resd 1 ; CELL 18 blocksize for filesystem I/O .st_blocks: resd 1 ; CELL 1c number of blocks allocated .st_atime: resd 1 ; CELL 20 time of last access .unused1: resd 1 ; CELL 24 .st_mtime: resd 1 ; CELL 28 time of last modification .unused2: resd 1 ; CELL 2c .st_ctime: resd 1 ; CELL 30 time of last change .unused3: resd 1 ; CELL 34 .unused4: resd 1 ; CELL 38 .unused5: resd 1 ; CELL 3c endstruc ----------------- 107 LSTAT const char *file_name, struct stat *buf get file status return -/- errors acces, badf, fault, loop, nametoolong, noent, nomem, notdir ref sys/stat.h, unistd.h, linux/stat.h ----------------- 108 FSTAT int fd, struct stat *buf get file status return -/- errors acces, badf, fault, loop, nametoolong, noent, nomem, notdir ref sys/stat.h, unistd.h, linux/stat.h -re- struct stat ----------------- 109 OLDUNAME (not existing any more) ----------------- 110 IOPL int level set all (65536) i/o ports permissions return -/- errors inval, perm ref unistd.h (libc5), sys/io.h (glibc), sys/perm.h ----------------- 111 VHANGUP void simulate hang-up on current tty return -/- errors perm ----------------- 112 IDLE make a process a candidate for swap, make process 0 idle; system boot-up, only return "init" does not return, any other job returns EPERM errors perm (any job except, "init" at booting up) sys_idle was removed w/ kernel vers. 2.3.13 ----------------- 113 VM86OLD struct vm86_struct *info pre 2.0.38: enter virtual 8086 mode return -/- errors perm (was "vm86" in pre 2.0.28 kernels) ----------------- 114 WAIT4 int status, pid_t pid, int options, struct rusage *rusage suspend current proc until child pid terminated or, signal received, -re- system call waitpid which implements a simplified variant. arg eax 114 ebx ptr to int item for state information on 2nd-ary ecx target process id or, more general specification edx options, zero or WNOHANG don't block waiting, WUNTRACED report status of stopped 2nd-aries esi ptr to rusage structure of system statistics return eax int exitted childs process id ebx ptr to process state (somewhat confused, sort of) information errors eax child, restartsys source kernel/exit.c ref USE_BSD, sys/types.h, sys/resource.h, sys/wait.h, waitpid syscall libc from bits/waitstatus.h status supplied as exit code @status := byte return code from child << 8 | byte signal stop code @status := byte signal << 8 | 127 can be interpretted WEXITSTATUS child's exit state in 2nd byte @status WIFEXITED true if l.s. 7 bits @status = 0 WIFSIGNALED signal number in/if l.s. 7 bits @status =/= 0 and byte @status =/= 127 WIFSTOPPED true if byte @status = 127 WSTOPSIG true if byte @status = 128 WTERMSIG terminating signal in l.s. 7 bits @status NOTE verify! libc docs appeare confused, inaccurate and carelessly compiled and, wrt "wait.." nothing at all documented in the kernel sources! ----------------- 115 SWAPOFF const char *path stop swapping to file/dev return -/- errors inval, noent, nomem, perm source mm/swapfile.c ref unistd.h, sys/swap.h, linux/swap.h ----------------- 116 SYSINFO struct sysinfo *sysinfo get system statistics return -/- errors fault ref man 2 sysinfo for structure spec. ----------------- 117 IPC ui call, int first, int second, int third, void *ptr, long fifth System V inter process commumication system calls return depend on function call errors depend on function call source sys_i386.c ----------------- 118 FSYNC int fd write file cache to disk return -/- ----------------- 119 SIGRETURN unsigned long __unused return from signal handler & cleanup stack frame return no return errors (crash...) ref kernel routine: linux/arch/i386/kernel/ ----------------- 120 CLONE configurably create resources sharing child process; P fork is a simplified "clone". arg ebx clone flags ecx ptr to top of (distinct!) stack space for clone pre-set to safe stack space if ecx=NULL edx ptr tp pt_regs structure - or NULL return eax pid of clone (caller), zero (clone) errors again, nomem flags CLONE_VM memory identity CLONE_FS file system identity CLONE_FILES files access identity CLONE_SIGHAND signals handlers identity CLONE_PID process id identity CLONE_PTRACE ptrace continuation into clone CLONE_VFORK wait until clone's mm_release CSIGNAL mask for signal to send on exit (0x0ff) ref linux/sched.h, asm/ptrace.h source arch/i386/kernel/process.c ----------------- 121 SETDOMAINNAME const char *name, size_t len set the system's domain name return -/- errors ----------------- 122 UNAME struct utsname *buf get name of & information abaut current kernel return -/- errors fault ref sys/utsname.h ----------------- 123 MODIFY_LDT int func, void *ptr, unsigned long bytecount get or set LDT return int no. of bytes read errors fault, inval, nosys ref linux/ldt.h, linux/unistd.h ----------------- 124 ADJTIMEX struct timex *buf tune kernel clock return int clockstate errors fault, inval, perm ref sys/timex.h ----------------- 125 MPROTECT cont void *addr, size_t len, int prot control access to a region of memory return -/- errors acces, fault, inval, nomem ref sys/mman.h ----------------- 126 SIGPROCMASK int how, const sigset_t *set, sigset_t *oldset POSIX signal handling return -/- errors fault, inval, intr ref signal.h, include/signal.h ----------------- 127 CREATE_MODULE const char *name, size_t size create loadable module entry return caddr_t kernel address of module errors exist, fault, inval, nomem ref linux/module.h ----------------- 128 INIT_MODULE const char *name, struct module *image initialize loadable module entry return -/- errors busy, fault, inval, noent, perm ref linux/module.h ----------------- 129 DELETE_MODULE const char *name remove a loadable module entry arg eax 129 ebx ptr to -terminated module name return eax -/- errors eax busy, fault, inval, noent, perm ref linux/module.h ----------------- 130 GET_KERNEL_SYMS retrieve exported kernel & modules symbols arg eax 130 ebx ptr to struct kernel_sym or, ebx NULL to receiving the no. of entries w/o retrieving any data return eax int no. of sysmbols received errors eax -none- ref linux/module.h ----------------- 131 QUOTACTL int cmd, const char *special int id caddr_t addr manipulate disk quota return -/- errors ref sys/types.h, sys/quota.h, linux/quota.h ----------------- 132 GETPGID pid_t pid get process group id return pid_t id errors inval, perm, srch ----------------- 133 FCHDIR int fd change working directory return -/- errors (fs & permissions) ----------------- 134 BDFLUSH int func long *address / data start, flush, or tune buffer-dirty-flush daemon return (dependent on func) errors busy, fault, inval, perm ----------------- 135 SYSFS int option, int option, const char *fname, int option unsigned int fs_index char *buf get f.s. type information, parm dep'd on opr return (depend on option) errors fault, inval ----------------- 136 PERSONALITY unsigned long persona set process execution domain return int previous persona errors inval ref linux/personality.h ----------------- 137 AFS_SYSCALL (n.i.) ----------------- 138 SETFSUID uid_t fsuid set user id for f.s. checks return int previous fsuid errors perm ----------------- 139 SETFSGID uid_t fsgid set group id for f.s. checks return int previous fsgid errors -/- ----------------- 140 LLSEEK reposition r/w file-ptr by offset (lseek for large files) arg eax 140 ebx uint fd ecx ulong disp.hi edx ulong disp.lo esi loff_t *res edi uint wh return edi ptr to big endian ordered double dword file-ptr position errors eax badf, inval ref fs/read_write.c max. file size in ext2 fs, pre-2.4.-kernel, is 2G bytes,i.e. disp-hi = 0 ----------------- 141 GETDENTS get directory entries arg eax 141 ebx uint fd ecx struct dirent *dirp edx uint count return eax no. of bytes read errors badf, fault, inval, noent, notdir ref unistd.h, linux/dirent.h, linux/unistd.h note False description of structure in man 2 de getdents: 2nd item, "d_off", is offset from beginning of directory file to concerning entry. struct dirent { long d_ino; __kernel_off_t d_off; unsigned short d_reclen; char d_name[256]; // We must not include limits.h! }; ----------------- 142 NEWSELECT K4:SELECT watch i/o events and exceptions at selected filedescriptors w. timeout arg eax 142 ebx uint top fd number + 1,up to FILE_MAX ecx zero or, ptr to fd bitfield for input edx zero or, ptr to fd bitfield for output esi zero or, ptr to fd bitfield for exceptions edi zero or, ptr to timeout values by timeval structure return eax no. of set fd-s or, zero after timeout bitfield and timeval data may unpredictably be modified by syscall errors eax badf: false fd bit set in a bitmask, intr: un-blocked signal received, inval: false top fd no., nomem: no memory for internal workspace ref arch/i386/kernel/sys_i386.c fdset files bitmask, timeval timeout data structure note ptr to an fdset bitfield bit-position of fd number wrt the bitfields base address, set for being watched rsp mode will be ignored if ptr = zero read the FILE_MAX kernel constant, max. of open files, from "/proc/sys/fs/file-max" ptr to timeval zero timeout returns immediately, infinite blocking if ptr to timeval structure = zero, -ve timeout returns INVAL. ----------------- 143 FLOCK int fd, int operation change file (advisory) locking return -/- errors wouldnoblock ref linux/Documentation/.../locks.txt & mandatory.txt ----------------- 144 MSYNC synchronize mapped file with memory arg eax 144 ebx range base address ecx size of range to synchronize edx zero or flag MS_ASYNC, MS_SYNC, MS_INVALIDATE return eax -/- errors eax fault (mem not mapped), inval (ptr un-aligned or, false flag-bits) ref unistd.h, sys/mman.h, asm/mman.h, linux/mman.h ----------------- 145 READV int fd, const struct iovec *vector, int count read a vector return -/- errors (file access) ref sys/uio.h, linux/uio.h ----------------- 146 WRITEV int fd, const struct iovec *vector, int count write a vector return -/- errors (file access) ref sys/uio.h, linux/uio.h ----------------- 147 GETSID pid_t pid get session id of calling process return int p errors srch ----------------- 148 FDATASYNC int fd flush file's data buffers to disk (meta data not syncronized) return -/- errors badf, inval, io, rofs ----------------- 149 SYSCTL struct sysctl_args *args read/write system parameters, device control errors should be, rarely is, further be documented in man 4 sections concerned ----------------- 150 MLOCK const void *addr, size_t len disable locking for selected memory areae return -/- errors inval, nomem, perm; no changes to memory locks ref sys/mman.h, asm/mman.h, linux/mman.h ----------------- 151 MUNLOCK const void *addr, size_t len re-enable paging for selected memory areae return -/- errors inval, nomem; no changes to memory locks ref sys/mman.h, asm/mman.h, linux/mman.h ----------------- 152 MLOCKALL int flags disable paging for calling process return -/- errors inval, nomem, perm ref sys/mman.h, asm/mman.h, linux/mman.h ----------------- 153 MUNLOCKALL void re-enable paging for calling process ref sys/mman.h, asm/mman.h, linux/mman.h ----------------- 154 SCHED_SETPARAM pid_t pid, const struct sched_param *p set scheduling parameters return -/- errors perm, srch ref linux/sched.h ----------------- 155 SCHED_GETPARAM pid_t pid, struct sched_param *p get scheduling parameters return -/- errors perm, srch ref linux/sched.h ----------------- 156 SCHED_SETSCHEDULER pid_t pid, int policy, const struct sched_param *p set scheduling algorithm/parameters return -/- errors perm, srch ref linux/sched.h ----------------- 157 SCHED_GETSCHEDULER pid_t pid get scheduling algorithm/parameters return uint policy errors perm, srch ref linux/sched.h ----------------- 158 SCHED_YIELD void relinquish (yield) processor without blocking ref linux/sched.h ----------------- 159 SCHED_GET_PRIORITY_MAX int policy get static priority range return int max priority for specified policy errors inval ref linux/sched.h ----------------- 160 SCHED_GET_PRIORITY_MIN int policy get static priority range return int min priority for specified policy errors inval ref linux/sched.h ----------------- 161 SCHED_RR_GET_INTERVAL pid_t pid struct timespec *tp get round robin time quantum for specified process or caller (pid=0) return -/- errors nosys, srch ref linux/sched.h ----------------- 162 NANOSLEEP suspend caller's execution for a specified time, w/ nanoseconds resolution. arg eax 162 ebx ptr to struct timespec w/ delay timing values. ecx ptr to alterable struct timespec. return eax zero or error code: intr, inval. ecx data-field in case of early termination receives remaining time ref linux/time.h timespec structure struct timespec { time_t tv_sec; // dword, seconds long tv_nsec; // dword, nanoseconds }; ----------------- 163 MREMAP remap virtual memory address arg eax 163 ebx old address, base address of current mapping ecx size of range to re-map. edx requested size. esi flags, zero or MREMAP_MAYMOVE (1) return eax int ptr to (new) virtual memory area. ptr may be -ve, errors coded in range 0xfffff000 < eax <= 0xffffffff. errors eax again, fault, inval, nomem ref unistd.h, sys/mman.h, asm/mman.h, linux/mman.h ----------------- 164 SETRESUID uid_t ruid, uid_t euid, uid_t suid set real, effective, saved user id return -/- errors perm ref kernel/sys.c, unistd.h ----------------- 165 GETRESUID uid_t *ruid, uid_t *euid, uid_t *suid get real, effective, saved user id return -/- errors fault ref kernel/sys.c, unistd.h ----------------- 166 VM86 unsigned long fn, struct vm86plus_struct *v86 enter virtual 8086 mode return depends on function fn ref sys/vm86.h, dosemu sources, asm/vm86.h ----------------- 167 QUERY_MODULE const char *name, int which void *buf, size_t bufsize, size_t *ret query kernel for various bits pertaining to module return -/- errors fault, inval, noent, nospc ref linux/module.h ----------------- 168 POLL struct pollfd *ufd, ui nfds, int timeout wait for event(s) on a file descriptor return int structure no. (dependent on events in *ufds) errors fault, intr, nomem ref asm/poll.h, linux/poll.h, sys/poll.h ----------------- 169 NFSSERVCTL int cmd, struct nfsctl_arg *argp, union nfsctl_res *resp interface to kernel nfs daemon ref nfsd/syscall.h ----------------- 170 SETRESGID gid_t rgid, gid_t egid, gid_t sgid set real, effective, saved group id return -/- errors perm ref kernel/sys.c, unistd.h ----------------- 171 GETRESGID uid_t *rgid, uid_t *egid, uid_t *sgid get real, effective, saved group id ----------------- 172 PRCTL int option, usigned long arg2, unsigned long arg3, usigned long arg4, usigned long arg5 operations on a process arg ebx flags - K4: PR_SET_PDEATHSIG, PR_GET_PDETSIG ecx ptr to bit-array of signal numbers affected, sigset_t return eax ptr to big endian ordered double dword file-ptr position errors inval, fault, intr ref linux/prctl.h; -re- sigaction source kernel/sys.c ----------------- 173 RT_SIGRETURN (kernel routine) ref syscall used in glibc source kernel/signal.c ----------------- 174 RT_SIGACTION int signum, const struct sigaction *act, struct sigaction *oldact ref syscall used in glibc source kernel/signal.c ----------------- 175 RT_SIGPROCMASK (kernel routine) ref syscall used in glibc source kernel/signal.c ----------------- 176 RT_SIGPENDING (kernel routine) ref syscall used in glibc source kernel/signal.c ----------------- 177 RT_SIGTIMEDWAIT (kernel routine) ref syscall used in glibc source kernel/signal.c ----------------- 178 RT_SIGQUEUEINFO int pid, int sig, siginfo_t *uinfo (kernel routine) ref syscall used in glibc source kernel/signal.c ----------------- 179 RT_SIGSUSPEND (kernel routine) ref syscall used in glic source kernel/signal.c, more ----------------- 180 PREAD int fd, void *buf, size_t count, off_t offset read from a file descriptor at given offset return ssize_t no. of bytes read, file offs. unchanged errors (file & acces, as with read, lseek) ----------------- 181 PWRITE int fd, void *buf, size_t count, off_t offset write to a file descriptor at given offset return ssize_t no. of bytes written, file offs. unchanged errors (file & acces, as with read, lseek) ----------------- 182 CHOWN const char *path, uid_t owner, gid_t group change ownership of a file return -/- errors (file & access) ref sys/types.h, unistd.h, linux/types.h ----------------- 183 GETCWD char *buf size_t size get current working directory return -/- errors range ----------------- 184 CAPGET cap_user_header_t header, cap_user_data_t data get process capabilities return -/- errors inval, perm ref sys/capability.h, linux/capability.h ----------------- 185 CAPSET cap_user_header_t header, const cap_user_data_t data set process capabilities return -/- errors inval, perm ref sys/capability.h, linux/capability.h ----------------- 186 SIGALTSTACK const stack_t *ss, stack_t *oss, unsigned long sp set-up alternate stack space for signal handlers arg eax 186 ebx ptr to new stack definition data structure ecx ptr to default stack definition data structure edx address of new stack ptr return eax -/- errors eax ref kernel/signal.c, linux/sched.h, linux/signal.h, asm/signal.h, signal.h no manual page exists ----------------- 187 SENDFILE int out_fd, int in_fd, off_t *offset, size_t count transfer data between file descriptors arg eax 187 ebx output file descriptor ecx input file descriptor edx ptr to 64-bit sized disp into source file esi count of byte to copy return eax no. of bytes transferred errors eax badf, inval, io, nomem ref mm/filemap.c note fast, kernel space file transfer. Output to any file type, input not from a socket or channel which doesn't support the mmap system call. destination file-ptr updated to end of transferred bytes, source unchanged input and output may be the same file. ----------------- 188 GETPMSG (n.i.) ----------------- 189 PUTPMSG (n.i.) ----------------- 190 VFORK void create child process & block parent return -/- errors again, nomem ----------------- 191 UGETGRLIMIT void (only 2.4.X) ----------------- 192 MMAP map files or devices into memory arg eax 192 ebx unsigned long address ecx unsigned long len edx unsigned long prot edi lont file descriptor esi unsigned long pgoff return -/- errors eax badf, fault, inval ref arch/i386/kernel/sys_i386.c ----------------- KERNEL 2.2.X: arch/i386/kernel/sys_i386.c int sys_pipe(unsigned long * fildes) long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) int old_mmap(struct mmap_arg_struct *arg) int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *) int old_select(struct sel_arg_struct *arg) int sys_uname(struct old_utsname * name) int sys_olduname(struct oldold_utsname * name) int sys_pause(void) arch/i386/kernel/ioport.c int sys_ioperm(unsigned long from, unsigned long num, int turn_on) int sys_iopl(unsigned long unused) arch/i386/kernel/process.c void ret_from_fork(void) __asm__("ret_from_fork"); int sys_idle(void) int sys_fork(struct pt_regs regs) int sys_clone(struct pt_regs regs) int sys_vfork(struct pt_regs regs) int sys_execve(struct pt_regs regs) arch/i386/kernel/vm86.c struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs)); int sys_vm86old(struct vm86_struct * v86) int sys_vm86(unsigned long subfunction, struct vm86plus_struct * v86) arch/i386/kernel/ptrace.c int sys_ptrace(long request, long pid, long addr, long data) void syscall_trace(void) arch/i386/kernel/signal.c int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)) int sys_sigreturn(unsigned long __unused) int sys_rt_sigreturn(unsigned long __unused) arch/i386/kernel/ldt.c int sys_modify_ldt(int func, void *ptr, unsigned long bytecount) drivers/char/vt.c int sys_ioperm(unsigned long from, unsigned long num, int on) fs/stat.c int sys_stat(char * filename, struct __old_kernel_stat * statbuf) int sys_newstat(char * filename, struct stat * statbuf) int sys_lstat(char * filename, struct __old_kernel_stat * statbuf) int sys_newlstat(char * filename, struct stat * statbuf) int sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf) int sys_newfstat(unsigned int fd, struct stat * statbuf) int sys_readlink(const char * path, char * buf, int bufsiz) fs/read_write.c off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) ssize_t sys_read(unsigned int fd, char * buf, size_t count) ssize_t sys_write(unsigned int fd, const char * buf, size_t count) fs/buffer.c int sys_sync(void) int sys_fsync(unsigned int fd) int sys_fdatasync(unsigned int fd) int sys_bdflush(int func, long data) fs/open.c int sys_statfs(const char * path, struct statfs * buf) int sys_fstatfs(unsigned int fd, struct statfs * buf) int sys_truncate(const char * path, unsigned long length) int sys_ftruncate(unsigned int fd, unsigned long length) int sys_utime(char * filename, struct utimbuf * times) int sys_utimes(char * filename, struct timeval * utimes) int sys_access(const char * filename, int mode) int sys_chdir(const char * filename) int sys_fchdir(unsigned int fd) int sys_chroot(const char * filename) int sys_fchmod(unsigned int fd, mode_t mode) int sys_chmod(const char * filename, mode_t mode) int sys_chown(const char * filename, uid_t user, gid_t group) int sys_lchown(const char * filename, uid_t user, gid_t group) int sys_fchown(unsigned int fd, uid_t user, gid_t group) int sys_open(const char * filename, int flags, int mode) int sys_creat(const char * pathname, int mode) int sys_close(unsigned int fd) int sys_vhangup(void) fs/exec.c int sys_uselib(const char * library) fs/super.c int sys_sysfs(int option, unsigned long arg1, unsigned long arg2) int sys_ustat(dev_t dev, struct ustat * ubuf) int sys_umount(char * name, int flags) int sys_oldumount(char * name) fs/fcntl.c int sys_dup2(unsigned int oldfd, unsigned int newfd) int sys_dup(unsigned int fildes) long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) fs/namei.c int sys_mknod(const char * filename, int mode, dev_t dev) int sys_mkdir(const char * pathname, int mode) int sys_rmdir(const char * pathname) int sys_unlink(const char * pathname) int sys_symlink(const char * oldname, const char * newname) int sys_link(const char * oldname, const char * newname) int sys_rename(const char * oldname, const char * newname) fs/ioctl.c int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) fs/select.c int sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout) fs/locks.c int sys_flock(unsigned int fd, unsigned int cmd) fs/filesystems.c sys_nfsservctl(int cmd, void *argp, void *resp) fs/dquot.c int sys_quotactl(int cmd, const char *special, int id, caddr_t addr) int sys_getcwd(char *buf, unsigned long size) fs/readdir.c int old_readdir(unsigned int fd, void * dirent, unsigned int count) int sys_getdents(unsigned int fd, void * dirent, unsigned int count) fs/noquot.c int sys_quotactl(int cmd, const char *special, int id, caddr_t addr) fs/nfsd/nfsctl.c handle_sys_nfsservctl(int cmd, void *opaque_argp, void *opaque_resp) include/linux/fs.h int sys_open(const char *, int, int); int sys_close(unsigned int); /* yes, it's really unsigned */ include/linux/shm.h int sys_shmget (key_t key, int size, int flag); int sys_shmat (int shmid, char *shmaddr, int shmflg, unsigned long *addr); int sys_shmdt (char *shmaddr); int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf); include/linux/sem.h int sys_semget (key_t key, int nsems, int semflg); int sys_semop (int semid, struct sembuf *sops, unsigned nsops); int sys_semctl (int semid, int semnum, int cmd, union semun arg); include/linux/msg.h int sys_msgget (key_t key, int msgflg); int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg); int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf); include/linux/personality.h int sys_personality(unsigned long personality); include/linux/swap.h int sys_swapoff(const char *); int sys_swapon(const char *, int); include/linux/sysctl.h int sys_sysctl(struct __sysctl_args *); include/linux/nfsd/syscall.h int sys_nfsservctl(int, void *, void *); ipc/msg.c int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg) int sys_msgget (key_t key, int msgflg) int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf) ipc/sem.c int sys_semget (key_t key, int nsems, int semflg) int sys_semctl (int semid, int semnum, int cmd, union semun arg) int sys_semop (int semid, struct sembuf *tsops, unsigned nsops) ipc/shm.c int sys_shmget (key_t key, int size, int shmflg) int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf) int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr) int sys_shmdt (char *shmaddr) ipc/util.c int sys_semget (key_t key, int nsems, int semflg) int sys_semop (int semid, struct sembuf *sops, unsigned nsops) int sys_semctl (int semid, int semnum, int cmd, union semun arg) int sys_msgget (key_t key, int msgflg) int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg) int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf) int sys_shmget (key_t key, int size, int flag) int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *addr) int sys_shmdt (char *shmaddr) int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf) kernel/sched.c void schedule(void) unsigned int sys_alarm(unsigned int seconds) int sys_getpid(void) int sys_getppid(void) int sys_getuid(void) int sys_geteuid(void) int sys_getgid(void) int sys_getegid(void) int sys_nice(int increment) int sys_sched_setparam(pid_t pid, struct sched_param *param) int sys_sched_getscheduler(pid_t pid) int sys_sched_getparam(pid_t pid, struct sched_param *param) int sys_sched_yield(void) int sys_sched_get_priority_max(int policy) int sys_sched_get_priority_min(int policy) int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval) int sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) kernel/exit.c int sys_exit(int error_code) int sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru) int sys_waitpid(pid_t pid,unsigned int * stat_addr, int options) kernel/panic.c void sys_sync(void); /* it's really int */ kernel/signal.c int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize) int sys_rt_sigpending(sigset_t *set, size_t sigsetsize) int sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo, const struct timespec *uts, size_t sigsetsize) int sys_kill(int pid, int sig) int sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo) int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset) int sys_sigpending(old_sigset_t *set) int sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) int sys_sgetmask(void) int sys_ssetmask(int newmask) unsigned long sys_signal(int sig, __sighandler_t handler) kernel/printk.c int sys_syslog(int type, char * buf, int len) int printk(const char *fmt, ...) kernel/sys.c int sys_ni_syscall(void) int sys_setpriority(int which, int who, int niceval) int sys_getpriority(int which, int who) int sys_reboot(int magic1, int magic2, int cmd, void * arg) int sys_setregid(gid_t rgid, gid_t egid) int sys_setgid(gid_t gid) int sys_setreuid(uid_t ruid, uid_t euid) int sys_setuid(uid_t uid) int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) int sys_setfsuid(uid_t uid) int sys_setfsgid(gid_t gid) long sys_times(struct tms * tbuf) int sys_setpgid(pid_t pid, pid_t pgid) int sys_getpgid(pid_t pid) int sys_getpgrp(void) int sys_getsid(pid_t pid) int sys_setsid(void) int sys_getgroups(int gidsetsize, gid_t *grouplist) int sys_setgroups(int gidsetsize, gid_t *grouplist) int sys_newuname(struct new_utsname * name) int sys_sethostname(char *name, int len) int sys_gethostname(char *name, int len) int sys_setdomainname(char *name, int len) int sys_getrlimit(unsigned int resource, struct rlimit *rlim) int sys_setrlimit(unsigned int resource, struct rlimit *rlim) int sys_getrusage(int who, struct rusage *ru) int sys_umask(int mask) kernel/module.c unsigned long sys_create_module(const char *name_user, size_t size) int sys_init_module(const char *name_user, struct module *mod_user) int sys_delete_module(const char *name_user) int sys_query_module(const char *name_user, int which, char *buf, size_t bufsize, size_t *ret) int sys_get_kernel_syms(struct kernel_sym *table) unsigned long sys_create_module(const char *name_user, size_t size) int sys_get_kernel_syms(struct kernel_sym *table) kernel/itimer.c int sys_getitimer(int which, struct itimerval *value) kernel/info.c int sys_sysinfo(struct sysinfo *info) kernel/time.c int sys_time(int * tloc) int sys_stime(int * tptr) int sys_gettimeofday(struct timeval *tv, struct timezone *tz) int sys_settimeofday(struct timeval *tv, struct timezone *tz) int sys_adjtimex(struct timex *txc_p) kernel/exec_domain.c static void no_lcall7(struct pt_regs * regs); static void no_lcall7(struct pt_regs * regs) int sys_personality(unsigned long personality) kernel/sysctl.c int sys_sysctl(struct __sysctl_args *args) int sys_sysctl(struct __sysctl_args *args) kernel/acct.c int sys_acct(const char *name) int sys_acct(const char * filename) kernel/capability.c int sys_capget(cap_user_header_t header, cap_user_data_t dataptr) int sys_capset(cap_user_header_t header, const cap_user_data_t data) mm/mmap.c unsigned long sys_brk(unsigned long brk) int sys_munmap(unsigned long addr, size_t len) mm/mprotect.c int sys_mprotect(unsigned long start, size_t len, unsigned long prot) mm/filemap.c ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) int sys_msync(unsigned long start, size_t len, int flags) mm/mlock.c int sys_mlock(unsigned long start, size_t len) int sys_munlock(unsigned long start, size_t len) int sys_mlockall(int flags) int sys_munlockall(void) mm/swapfile.c int sys_swapoff(const char * specialfile) int sys_swapon(const char * specialfile, int swap_flags) mm/mremap.c unsigned long sys_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags) net/socket.c int sys_socket(int family, int type, int protocol) int sys_socketpair(int family, int type, int protocol, int usockvec[2]) int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen) int sys_listen(int fd, int backlog) int sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_addrlen) int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen) int sys_getsockname(int fd, struct sockaddr *usockaddr, int *usockaddr_len) int sys_getpeername(int fd, struct sockaddr *usockaddr, int *usockaddr_len) int sys_send(int fd, void * buff, size_t len, unsigned flags) int sys_recv(int fd, void * ubuf, size_t size, unsigned flags) int sys_setsockopt(int fd, int level, int optname, char *optval, int optlen) int sys_getsockopt(int fd, int level, int optname, char *optval, int *optlen) int sys_shutdown(int fd, int how) int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags) int sys_recvmsg(int fd, struct msghdr *msg, unsigned int flags) int sys_socketcall(int call, unsigned long *args)