Linux 2.4.29 System Calls Table (LSCT)

jollen 發表於 October 7, 2006 1:11 PM

以下是 Linux 2.4.29 的 system call 整理表格,提供給「Embedded Linux 嵌入式系統實作演練」的讀者您做參考。這是一張很方便的表格,可以取代 unistd.h 與 "man"。

這張工具表格可以幫助我們:

1. 最主要的目的:當然是研究作業系統,了解 Linux 提供的 sytsem call service。
2. Trace kernel.
3. Writing shellcode.

供您參考 :)
Linux (kernel 2.4.29) System Call Table

1. sys_ni_syscall 為保留號碼
2. 更新日期: 2006/10/07
3. 其實與 linux 2.4.22 是相同的,因此亦可參考我們之前 (3 年前) 整理的 LSCT。

no Syscall Prototype decl.
0 sys_ni_syscall long sys_ni_syscall(void) 
1 sys_exit long sys_exit(int error_code) 
2 sys_fork int sys_fork(struct pt_regs regs) 
3 sys_read ssize_t sys_read(unsigned int fd, char *buf, size_t count) 
4 sys_write ssize_t sys_write(unsigned int fd, const char *buf, size_t count) 
5 sys_open long sys_open(const char *filename, int flags, int mode) 
6 sys_close long sys_close(unsigned int fd) 
7 sys_waitpid long sys_waitpid(pid_t pid, unsigned int *stat_addr, int options) 
8 sys_creat long sys_creat(const char *pathname, int mode) 
9 sys_link long sys_link(const char *oldname, const char *newname) 
10 sys_unlink long sys_unlink(const char *pathname) 
11 sys_execve int sys_execve(struct pt_regs regs) 
12 sys_chdir long sys_chdir(const char *filename) 
13 sys_time long sys_time(int *tloc) 
14 sys_mknod long sys_mknod(const char *filename, int mode, dev_t dev) 
15 sys_chmod long sys_chmod(const char *filename, mode_t mode) 
16 sys_lchown16 long sys_lchown16(const char *filename, old_uid_t user, old_gid_t group) 
17 sys_ni_syscall long sys_ni_syscall(void) 
18 sys_stat long sys_stat(char *filename, struct __old_kernel_stat *statbuf) 
19 sys_lseek off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) 
20 sys_getpid long sys_getpid(void) 
21 sys_mount long sys_mount(char *dev_name, char *dir_name, char *type, unsigned long flags, void *data) 
22 sys_oldumount long sys_oldumount(char *name) 
23 sys_setuid16 long sys_setuid16(old_uid_t uid) 
24 sys_getuid16 long sys_getuid16(void) 
25 sys_stime long sys_stime(int *tptr) 
26 sys_ptrace int sys_ptrace(long request, long pid, long addr, long data) 
27 sys_alarm unsigned long sys_alarm(unsigned int seconds) 
28 sys_fstat long sys_fstat(unsigned int fd, struct __old_kernel_stat *statbuf) 
29 sys_pause int sys_pause(void) 
30 sys_utime long sys_utime(char *filename, struct utimbuf *times) 
31 sys_ni_syscall long sys_ni_syscall(void) 
32 sys_ni_syscall long sys_ni_syscall(void) 
33 sys_access long sys_access(const char *filename, int mode) 
34 sys_nice long sys_nice(int increment) 
35 sys_ni_syscall long sys_ni_syscall(void) 
36 sys_sync long sys_sync(void) 
37 sys_kill long sys_kill(int pid, int sig) 
38 sys_rename long sys_rename(const char *oldname, const char *newname) 
39 sys_mkdir long sys_mkdir(const char *pathname, int mode) 
40 sys_rmdir long sys_rmdir(const char *pathname) 
41 sys_dup long sys_dup(unsigned int fildes) 
42 sys_pipe int sys_pipe(unsigned long *fildes) 
43 sys_times long sys_times(struct tms *tbuf) 
44 sys_ni_syscall long sys_ni_syscall(void) 
45 sys_brk unsigned long sys_brk(unsigned long brk) 
46 sys_setgid16 long sys_setgid16(old_gid_t gid) 
47 sys_getgid16 long sys_getgid16(void) 
48 sys_signal unsigned long sys_signal(int sig, __sighandler_t handler) 
49 sys_geteuid16 long sys_geteuid16(void) 
50 sys_getegid16 long sys_getegid16(void) 
51 sys_acct long sys_acct(const char *name) 
52 sys_umount long sys_umount(char *name, int flags) 
53 sys_ni_syscall long sys_ni_syscall(void) 
54 sys_ioctl long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) 
55 sys_fcntl long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) 
56 sys_ni_syscall long sys_ni_syscall(void) 
57 sys_setpgid long sys_setpgid(pid_t pid, pid_t pgid) 
58 sys_ni_syscall long sys_ni_syscall(void) 
59 sys_olduname int sys_olduname(struct oldold_utsname *name) 
60 sys_umask long sys_umask(int mask) 
61 sys_chroot long sys_chroot(const char *filename) 
62 sys_ustat long sys_ustat(dev_t dev, struct ustat *ubuf) 
63 sys_dup2 long sys_dup2(unsigned int oldfd, unsigned int newfd) 
64 sys_getppid long sys_getppid(void) 
65 sys_getpgrp long sys_getpgrp(void) 
66 sys_setsid long sys_setsid(void) 
67 sys_sigaction int sys_sigaction(int sig, const struct old_sigaction *act, struct old_sigaction *oact) 
68 sys_sgetmask long sys_sgetmask(void) 
69 sys_ssetmask long sys_ssetmask(int newmask) 
70 sys_setreuid16 long sys_setreuid16(old_uid_t ruid, old_uid_t euid) 
71 sys_setregid16 long sys_setregid16(old_gid_t rgid, old_gid_t egid) 
72 sys_sigsuspend int sys_sigsuspend(int history0, int history1, old_sigset_t mask) 
73 sys_sigpending long sys_sigpending(old_sigset_t * set) 
74 sys_sethostname long sys_sethostname(char *name, int len) 
75 sys_setrlimit long sys_setrlimit(unsigned int resource, struct rlimit *rlim) 
76 sys_old_getrlimit long sys_old_getrlimit(unsigned int resource, struct rlimit *rlim) 
77 sys_getrusage long sys_getrusage(int who, struct rusage *ru) 
78 sys_gettimeofday long sys_gettimeofday(struct timeval *tv, struct timezone *tz) 
79 sys_settimeofday long sys_settimeofday(struct timeval *tv, struct timezone *tz) 
80 sys_getgroups16 long sys_getgroups16(int gidsetsize, old_gid_t * grouplist) 
81 sys_setgroups16 long sys_setgroups16(int gidsetsize, old_gid_t * grouplist) 
82 old_select int old_select(struct sel_arg_struct *arg) 
83 sys_symlink long sys_symlink(const char *oldname, const char *newname) 
84 sys_lstat long sys_lstat(char *filename, struct __old_kernel_stat *statbuf) 
85 sys_readlink long sys_readlink(const char *path, char *buf, int bufsiz) 
86 sys_uselib long sys_uselib(const char *library) 
87 sys_swapon long sys_swapon(const char *specialfile, int swap_flags) 
88 sys_reboot long sys_reboot(int magic1, int magic2, unsigned int cmd, void *arg) 
89 old_readdir int old_readdir(unsigned int fd, void *dirent, unsigned int count) 
90 old_mmap int old_mmap(struct mmap_arg_struct *arg) 
91 sys_munmap long sys_munmap(unsigned long addr, size_t len) 
92 sys_truncate long sys_truncate(const char *path, unsigned long length) 
93 sys_ftruncate long sys_ftruncate(unsigned int fd, unsigned long length) 
94 sys_fchmod long sys_fchmod(unsigned int fd, mode_t mode) 
95 sys_fchown16 long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) 
96 sys_getpriority long sys_getpriority(int which, int who) 
97 sys_setpriority long sys_setpriority(int which, int who, int niceval) 
98 sys_ni_syscall long sys_ni_syscall(void) 
99 sys_statfs long sys_statfs(const char *path, struct statfs *buf) 
100 sys_fstatfs long sys_fstatfs(unsigned int fd, struct statfs *buf) 
101 sys_ioperm int sys_ioperm(unsigned long from, unsigned long num, int turn_on) 
102 sys_socketcall long sys_socketcall(int call, unsigned long *args) 
103 sys_syslog long sys_syslog(int type, char *buf, int len) 
104 sys_setitimer long sys_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) 
105 sys_getitimer long sys_getitimer(int which, struct itimerval *value) 
106 sys_newstat long sys_newstat(char *filename, struct stat *statbuf) 
107 sys_newlstat long sys_newlstat(char *filename, struct stat *statbuf) 
108 sys_newfstat long sys_newfstat(unsigned int fd, struct stat *statbuf) 
109 sys_uname int sys_uname(struct old_utsname *name) 
110 sys_iopl int sys_iopl(unsigned long unused) 
111 sys_vhangup long sys_vhangup(void) 
112 sys_ni_syscall long sys_ni_syscall(void) 
113 sys_vm86old int sys_vm86old(struct vm86_struct *v86) 
114 sys_wait4 long sys_wait4(pid_t pid, unsigned int *stat_addr, int options, struct rusage *ru) 
115 sys_swapoff long sys_swapoff(const char *specialfile) 
116 sys_sysinfo long sys_sysinfo(struct sysinfo *info) 
117 sys_ipc int sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) 
118 sys_fsync long sys_fsync(unsigned int fd) 
119 sys_sigreturn int sys_sigreturn(unsigned long __unused) 
120 sys_clone int sys_clone(struct pt_regs regs) 
121 sys_setdomainname long sys_setdomainname(char *name, int len) 
122 sys_newuname long sys_newuname(struct new_utsname *name) 
123 sys_modify_ldt int sys_modify_ldt(int func, void *ptr, unsigned long bytecount) 
124 sys_adjtimex long sys_adjtimex(struct timex *txc_p) 
125 sys_mprotect long sys_mprotect(unsigned long start, size_t len, unsigned long prot) 
126 sys_sigprocmask long sys_sigprocmask(int how, old_sigset_t * set, old_sigset_t * oset) 
127 sys_create_module unsigned long sys_create_module(const char *name_user, size_t size) 
128 sys_init_module long sys_init_module(const char *name_user, struct module *mod_user) 
129 sys_delete_module long sys_delete_module(const char *name_user) 
130 sys_get_kernel_syms long sys_get_kernel_syms(struct kernel_sym *table) 
131 sys_quotactl long sys_quotactl(unsigned int cmd, const char *special, qid_t id, caddr_t addr) 
132 sys_getpgid long sys_getpgid(pid_t pid) 
133 sys_fchdir long sys_fchdir(unsigned int fd) 
134 sys_bdflush long sys_bdflush(int func, long data) 
135 sys_sysfs long sys_sysfs(int option, unsigned long arg1, unsigned long arg2) 
136 sys_personality long sys_personality(u_long personality) 
137 sys_ni_syscall long sys_ni_syscall(void) 
138 sys_setfsuid16 long sys_setfsuid16(old_uid_t uid) 
139 sys_setfsgid16 long sys_setfsgid16(old_gid_t gid) 
140 sys_llseek long sys_llseek(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin) 
141 sys_getdents long sys_getdents(unsigned int fd, void *dirent, unsigned int count) 
142 sys_select long sys_select(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timeval *tvp) 
143 sys_flock long sys_flock(unsigned int fd, unsigned int cmd) 
144 sys_msync long sys_msync(unsigned long start, size_t len, int flags) 
145 sys_readv ssize_t sys_readv(unsigned long fd, const struct iovec * vector, unsigned long count) 
146 sys_writev ssize_t sys_writev(unsigned long fd, const struct iovec * vector, unsigned long count) 
147 sys_getsid long sys_getsid(pid_t pid) 
148 sys_fdatasync long sys_fdatasync(unsigned int fd) 
149 sys_sysctl long sys_sysctl(struct __sysctl_args *args) 
150 sys_mlock long sys_mlock(unsigned long start, size_t len) 
151 sys_munlock long sys_munlock(unsigned long start, size_t len) 
152 sys_mlockall long sys_mlockall(int flags) 
153 sys_munlockall long sys_munlockall(void) 
154 sys_sched_setparam long sys_sched_setparam(pid_t pid, struct sched_param *param) 
155 sys_sched_getparam long sys_sched_getparam(pid_t pid, struct sched_param *param) 
156 sys_sched_setscheduler long sys_sched_setscheduler(pid_t pid, int policy, struct sched_param *param) 
157 sys_sched_getscheduler long sys_sched_getscheduler(pid_t pid) 
158 sys_sched_yield long sys_sched_yield(void) 
159 sys_sched_get_priority_max long sys_sched_get_priority_max(int policy) 
160 sys_sched_get_priority_min long sys_sched_get_priority_min(int policy) 
161 sys_sched_rr_get_interval long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval) 
162 sys_nanosleep long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) 
163 sys_mremap unsigned long sys_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr) 
164 sys_setresuid16 long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) 
165 sys_getresuid16 long sys_getresuid16(old_uid_t * ruid, old_uid_t * euid, old_uid_t * suid) 
166 sys_vm86 int sys_vm86(unsigned long subfunction, struct vm86plus_struct *v86) 
167 sys_query_module long sys_query_module(const char *name_user, int which, char *buf, size_t bufsize, size_t * ret) 
168 sys_poll long sys_poll(struct pollfd *ufds, unsigned int nfds, long timeout) 
169 sys_nfsservctl  
170 sys_setresgid16 long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) 
171 sys_getresgid16 long sys_getresgid16(old_gid_t * rgid, old_gid_t * egid, old_gid_t * sgid) 
172 sys_prctl long sys_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) 
173 sys_rt_sigreturn int sys_rt_sigreturn(unsigned long __unused) 
174 sys_rt_sigaction long sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 
175 sys_rt_sigprocmask long sys_rt_sigprocmask(int how, sigset_t * set, sigset_t * oset, size_t sigsetsize) 
176 sys_rt_sigpending long sys_rt_sigpending(sigset_t * set, size_t sigsetsize) 
177 sys_rt_sigtimedwait long sys_rt_sigtimedwait(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec *uts, size_t sigsetsize) 
178 sys_rt_sigqueueinfo long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t * uinfo) 
179 sys_rt_sigsuspend int sys_rt_sigsuspend(sigset_t * unewset, size_t sigsetsize) 
180 sys_pread ssize_t sys_pread(unsigned int fd, char *buf, size_t count, loff_t pos) 
181 sys_pwrite ssize_t sys_pwrite(unsigned int fd, const char *buf, size_t count, loff_t pos) 
182 sys_chown16 long sys_chown16(const char *filename, old_uid_t user, old_gid_t group) 
183 sys_getcwd long sys_getcwd(char *buf, unsigned long size) 
184 sys_capget long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) 
185 sys_capset long sys_capset(cap_user_header_t header, const cap_user_data_t data) 
186 sys_sigaltstack int sys_sigaltstack(const stack_t * uss, stack_t * uoss) 
187 sys_sendfile ssize_t sys_sendfile(int out_fd, int in_fd, off_t * offset, size_t count) 
188 sys_ni_syscall long sys_ni_syscall(void) 
189 sys_ni_syscall long sys_ni_syscall(void) 
190 sys_vfork int sys_vfork(struct pt_regs regs) 
191 sys_getrlimit long sys_getrlimit(unsigned int resource, struct rlimit *rlim) 
192 sys_mmap2 long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) 
193 sys_truncate64 long sys_truncate64(const char *path, loff_t length) 
194 sys_ftruncate64 long sys_ftruncate64(unsigned int fd, loff_t length) 
195 sys_stat64 long sys_stat64(char *filename, struct stat64 *statbuf, long flags) 
196 sys_lstat64 long sys_lstat64(char *filename, struct stat64 *statbuf, long flags) 
197 sys_fstat64 long sys_fstat64(unsigned long fd, struct stat64 *statbuf, long flags) 
198 sys_lchown long sys_lchown(const char *filename, uid_t user, gid_t group) 
199 sys_getuid long sys_getuid(void) 
200 sys_getgid long sys_getgid(void) 
201 sys_geteuid long sys_geteuid(void) 
202 sys_getegid long sys_getegid(void) 
203 sys_setreuid long sys_setreuid(uid_t ruid, uid_t euid) 
204 sys_setregid long sys_setregid(gid_t rgid, gid_t egid) 
205 sys_getgroups long sys_getgroups(int gidsetsize, gid_t * grouplist) 
206 sys_setgroups long sys_setgroups(int gidsetsize, gid_t * grouplist) 
207 sys_fchown long sys_fchown(unsigned int fd, uid_t user, gid_t group) 
208 sys_setresuid long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) 
209 sys_getresuid long sys_getresuid(uid_t * ruid, uid_t * euid, uid_t * suid) 
210 sys_setresgid long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) 
211 sys_getresgid long sys_getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid) 
212 sys_chown long sys_chown(const char *filename, uid_t user, gid_t group) 
213 sys_setuid long sys_setuid(uid_t uid) 
214 sys_setgid long sys_setgid(gid_t gid) 
215 sys_setfsuid long sys_setfsuid(uid_t uid) 
216 sys_setfsgid long sys_setfsgid(gid_t gid) 
217 sys_pivot_root long sys_pivot_root(const char *new_root, const char *put_old) 
218 sys_mincore long sys_mincore(unsigned long start, size_t len, unsigned char *vec) 
219 sys_madvise long sys_madvise(unsigned long start, size_t len, int behavior) 
220 sys_getdents64 long sys_getdents64(unsigned int fd, void *dirent, unsigned int count) 
221 sys_fcntl64 long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) 
222 sys_ni_syscall long sys_ni_syscall(void) 
223 sys_ni_syscall long sys_ni_syscall(void) 
224 sys_gettid long sys_gettid(void) 
225 sys_readahead ssize_t sys_readahead(int fd, loff_t offset, size_t count) 
226 sys_setxattr long sys_setxattr(char *path, char *name, void *value, size_t size, int flags) 
227 sys_lsetxattr long sys_lsetxattr(char *path, char *name, void *value, size_t size, int flags) 
228 sys_fsetxattr long sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags) 
229 sys_getxattr ssize_t sys_getxattr(char *path, char *name, void *value, size_t size) 
230 sys_lgetxattr ssize_t sys_lgetxattr(char *path, char *name, void *value, size_t size) 
231 sys_fgetxattr ssize_t sys_fgetxattr(int fd, char *name, void *value, size_t size) 
232 sys_listxattr ssize_t sys_listxattr(char *path, char *list, size_t size) 
233 sys_llistxattr ssize_t sys_llistxattr(char *path, char *list, size_t size) 
234 sys_flistxattr ssize_t sys_flistxattr(int fd, char *list, size_t size) 
235 sys_removexattr long sys_removexattr(char *path, char *name) 
236 sys_lremovexattr long sys_lremovexattr(char *path, char *name) 
237 sys_fremovexattr long sys_fremovexattr(int fd, char *name) 
238 sys_tkill long sys_tkill(int pid, int sig) 
239 sys_sendfile64 ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t * offset, size_t count) 
240 sys_ni_syscall long sys_ni_syscall(void) 
241 sys_ni_syscall long sys_ni_syscall(void) 
242 sys_ni_syscall long sys_ni_syscall(void) 
243 sys_ni_syscall long sys_ni_syscall(void) 
244 sys_ni_syscall long sys_ni_syscall(void) 
245 sys_ni_syscall long sys_ni_syscall(void) 
246 sys_ni_syscall long sys_ni_syscall(void) 
247 sys_ni_syscall long sys_ni_syscall(void) 
248 sys_ni_syscall long sys_ni_syscall(void) 
249 sys_ni_syscall long sys_ni_syscall(void) 
250 sys_ni_syscall long sys_ni_syscall(void) 
251 sys_ni_syscall long sys_ni_syscall(void) 
252 sys_ni_syscall long sys_ni_syscall(void) 
253 sys_ni_syscall long sys_ni_syscall(void) 
254 sys_ni_syscall long sys_ni_syscall(void) 
255 sys_ni_syscall long sys_ni_syscall(void) 
256 sys_ni_syscall long sys_ni_syscall(void) 
257 sys_ni_syscall long sys_ni_syscall(void) 
258 sys_ni_syscall long sys_ni_syscall(void) 
259 sys_ni_syscall long sys_ni_syscall(void) 

Jollen's Blog 使用 Github issues 與讀者交流討論。請點擊上方的文章專屬 issue,或 open a new issue

您可透過電子郵件 jollen@jollen.org,或是 Linkedin 與我連絡。更歡迎使用微信,請搜尋 WeChat ID:jollentw