Linux 2.6 的 System Call:12 大類

jollen 發表於 October 11, 2006 2:58 PM

把 Linux 提供的 sytsem call service 依分類做整理,並提供實作檔案。本表使用於 Jollen 的「2. GNU Toolchains 與 Embedded Linux Programming」課程中,在此提供給大家做參考。目前依據 Linux 2.6.11 原始碼製成,請搭配 2.6.11 以上的版本做研究。

no Syscall name Implementation file in Linux 2.6.11 (or above)

目前大致把 Linux 2.6.11 的 system call 分成以下幾個類別:

最後一個欄位列出該 system call 實作的檔案 (以 Linux 2.6.11 為主)。請注意,Blog 裡並沒有該檔案的 hyperlink,您可以複制本 blog,並準備一份 Linux 2.6.11 (or above) 的原始碼,以方便 link 到檔案做查詢。

Machine-dependent (i386)
101 sys_ioperm linux/arch/i386/kernel/ioport.c
110 sys_iopl linux/arch/i386/kernel/ioport.c
123 sys_modify_ldt linux/arch/i386/kernel/ldt.c
2 sys_fork linux/arch/i386/kernel/process.c
11 sys_execve linux/arch/i386/kernel/process.c
120 sys_clone linux/arch/i386/kernel/process.c
190 sys_vfork linux/arch/i386/kernel/process.c
243 sys_set_thread_area linux/arch/i386/kernel/process.c
244 sys_get_thread_area linux/arch/i386/kernel/process.c
26 sys_ptrace linux/arch/i386/kernel/ptrace.c
67 sys_sigaction linux/arch/i386/kernel/signal.c
72 sys_sigsuspend linux/arch/i386/kernel/signal.c
119 sys_sigreturn linux/arch/i386/kernel/signal.c
173 sys_rt_sigreturn linux/arch/i386/kernel/signal.c
179 sys_rt_sigsuspend linux/arch/i386/kernel/signal.c
186 sys_sigaltstack linux/arch/i386/kernel/signal.c
42 sys_pipe linux/arch/i386/kernel/sys_i386.c
59 sys_olduname linux/arch/i386/kernel/sys_i386.c
82 old_select linux/arch/i386/kernel/sys_i386.c
90 old_mmap linux/arch/i386/kernel/sys_i386.c
109 sys_uname linux/arch/i386/kernel/sys_i386.c
117 sys_ipc linux/arch/i386/kernel/sys_i386.c
192 sys_mmap2 linux/arch/i386/kernel/sys_i386.c
113 sys_vm86old linux/arch/i386/kernel/vm86.c
166 sys_vm86 linux/arch/i386/kernel/vm86.c
Filesystem
245 sys_io_setup linux/fs/aio.c
246 sys_io_destroy linux/fs/aio.c
247 sys_io_getevents linux/fs/aio.c
248 sys_io_submit linux/fs/aio.c
249 sys_io_cancel linux/fs/aio.c
36 sys_sync linux/fs/buffer.c
118 sys_fsync linux/fs/buffer.c
134 sys_bdflush linux/fs/buffer.c
148 sys_fdatasync linux/fs/buffer.c
183 sys_getcwd linux/fs/dcache.c
253 sys_lookup_dcookie linux/fs/dcookies.c
254 sys_epoll_create linux/fs/eventpoll.c
255 sys_epoll_ctl linux/fs/eventpoll.c
256 sys_epoll_wait linux/fs/eventpoll.c
86 sys_uselib linux/fs/exec.c
41 sys_dup linux/fs/fcntl.c
55 sys_fcntl linux/fs/fcntl.c
63 sys_dup2 linux/fs/fcntl.c
221 sys_fcntl64 linux/fs/fcntl.c
135 sys_sysfs linux/fs/filesystems.c
54 sys_ioctl linux/fs/ioctl.c
143 sys_flock linux/fs/locks.c
9 sys_link linux/fs/namei.c
10 sys_unlink linux/fs/namei.c
14 sys_mknod linux/fs/namei.c
38 sys_rename linux/fs/namei.c
39 sys_mkdir linux/fs/namei.c
40 sys_rmdir linux/fs/namei.c
83 sys_symlink linux/fs/namei.c
21 sys_mount linux/fs/namespace.c
22 sys_oldumount linux/fs/namespace.c
52 sys_umount linux/fs/namespace.c
217 sys_pivot_root linux/fs/namespace.c
169 sys_nfsservctl linux/fs/nfsctl.c
5 sys_open linux/fs/open.c
6 sys_close linux/fs/open.c
8 sys_creat linux/fs/open.c
12 sys_chdir linux/fs/open.c
15 sys_chmod linux/fs/open.c
30 sys_utime linux/fs/open.c
33 sys_access linux/fs/open.c
61 sys_chroot linux/fs/open.c
92 sys_truncate linux/fs/open.c
93 sys_ftruncate linux/fs/open.c
94 sys_fchmod linux/fs/open.c
99 sys_statfs linux/fs/open.c
100 sys_fstatfs linux/fs/open.c
111 sys_vhangup linux/fs/open.c
133 sys_fchdir linux/fs/open.c
193 sys_truncate64 linux/fs/open.c
194 sys_ftruncate64 linux/fs/open.c
198 sys_lchown linux/fs/open.c
207 sys_fchown linux/fs/open.c
212 sys_chown linux/fs/open.c
268 sys_statfs64 linux/fs/open.c
269 sys_fstatfs64 linux/fs/open.c
131 sys_quotactl linux/fs/quota.c
89 old_readdir linux/fs/readdir.c
141 sys_getdents linux/fs/readdir.c
220 sys_getdents64 linux/fs/readdir.c
3 sys_read linux/fs/read_write.c
4 sys_write linux/fs/read_write.c
19 sys_lseek linux/fs/read_write.c
140 sys_llseek linux/fs/read_write.c
145 sys_readv linux/fs/read_write.c
146 sys_writev linux/fs/read_write.c
180 sys_pread64 linux/fs/read_write.c
181 sys_pwrite64 linux/fs/read_write.c
187 sys_sendfile linux/fs/read_write.c
239 sys_sendfile64 linux/fs/read_write.c
142 sys_select linux/fs/select.c
168 sys_poll linux/fs/select.c
18 sys_stat linux/fs/stat.c
28 sys_fstat linux/fs/stat.c
84 sys_lstat linux/fs/stat.c
85 sys_readlink linux/fs/stat.c
106 sys_newstat linux/fs/stat.c
107 sys_newlstat linux/fs/stat.c
108 sys_newfstat linux/fs/stat.c
195 sys_stat64 linux/fs/stat.c
196 sys_lstat64 linux/fs/stat.c
197 sys_fstat64 linux/fs/stat.c
62 sys_ustat linux/fs/super.c
226 sys_setxattr linux/fs/xattr.c
227 sys_lsetxattr linux/fs/xattr.c
228 sys_fsetxattr linux/fs/xattr.c
229 sys_getxattr linux/fs/xattr.c
230 sys_lgetxattr linux/fs/xattr.c
231 sys_fgetxattr linux/fs/xattr.c
232 sys_listxattr linux/fs/xattr.c
233 sys_llistxattr linux/fs/xattr.c
234 sys_flistxattr linux/fs/xattr.c
235 sys_removexattr linux/fs/xattr.c
236 sys_lremovexattr linux/fs/xattr.c
237 sys_fremovexattr linux/fs/xattr.c
Linux Kernel
51 sys_acct linux/kernel/acct.c
184 sys_capget linux/kernel/capability.c
185 sys_capset linux/kernel/capability.c
136 sys_personality linux/kernel/exec_domain.c
1 sys_exit linux/kernel/exit.c
7 sys_waitpid linux/kernel/exit.c
114 sys_wait4 linux/kernel/exit.c
252 sys_exit_group linux/kernel/exit.c
258 sys_set_tid_address linux/kernel/fork.c
240 sys_futex linux/kernel/futex.c
104 sys_setitimer linux/kernel/itimer.c
105 sys_getitimer linux/kernel/itimer.c
128 sys_init_module linux/kernel/module.c
129 sys_delete_module linux/kernel/module.c
162 sys_nanosleep linux/kernel/posix-timers.c
259 sys_timer_create linux/kernel/posix-timers.c
260 sys_timer_settime linux/kernel/posix-timers.c
261 sys_timer_gettime linux/kernel/posix-timers.c
262 sys_timer_getoverrun linux/kernel/posix-timers.c
263 sys_timer_delete linux/kernel/posix-timers.c
264 sys_clock_settime linux/kernel/posix-timers.c
265 sys_clock_gettime linux/kernel/posix-timers.c
266 sys_clock_getres linux/kernel/posix-timers.c
267 sys_clock_nanosleep linux/kernel/posix-timers.c
103 sys_syslog linux/kernel/printk.c
Scheduling
34 sys_nice linux/kernel/sched.c
154 sys_sched_setparam linux/kernel/sched.c
155 sys_sched_getparam linux/kernel/sched.c
156 sys_sched_setscheduler linux/kernel/sched.c
157 sys_sched_getscheduler linux/kernel/sched.c
158 sys_sched_yield linux/kernel/sched.c
159 sys_sched_get_priority_max linux/kernel/sched.c
160 sys_sched_get_priority_min linux/kernel/sched.c
161 sys_sched_rr_get_interval linux/kernel/sched.c
241 sys_sched_setaffinity linux/kernel/sched.c
242 sys_sched_getaffinity linux/kernel/sched.c
Signals
0 sys_restart_syscall linux/kernel/signal.c
29 sys_pause linux/kernel/signal.c
37 sys_kill linux/kernel/signal.c
48 sys_signal linux/kernel/signal.c
68 sys_sgetmask linux/kernel/signal.c
69 sys_ssetmask linux/kernel/signal.c
73 sys_sigpending linux/kernel/signal.c
126 sys_sigprocmask linux/kernel/signal.c
174 sys_rt_sigaction linux/kernel/signal.c
175 sys_rt_sigprocmask linux/kernel/signal.c
176 sys_rt_sigpending linux/kernel/signal.c
177 sys_rt_sigtimedwait linux/kernel/signal.c
178 sys_rt_sigqueueinfo linux/kernel/signal.c
238 sys_tkill linux/kernel/signal.c
270 sys_tgkill linux/kernel/signal.c
Systems
43 sys_times linux/kernel/sys.c
57 sys_setpgid linux/kernel/sys.c
60 sys_umask linux/kernel/sys.c
65 sys_getpgrp linux/kernel/sys.c
66 sys_setsid linux/kernel/sys.c
74 sys_sethostname linux/kernel/sys.c
75 sys_setrlimit linux/kernel/sys.c
76 sys_old_getrlimit linux/kernel/sys.c
77 sys_getrusage linux/kernel/sys.c
88 sys_reboot linux/kernel/sys.c
96 sys_getpriority linux/kernel/sys.c
97 sys_setpriority linux/kernel/sys.c
121 sys_setdomainname linux/kernel/sys.c
122 sys_newuname linux/kernel/sys.c
132 sys_getpgid linux/kernel/sys.c
147 sys_getsid linux/kernel/sys.c
172 sys_prctl linux/kernel/sys.c
191 sys_getrlimit linux/kernel/sys.c
203 sys_setreuid linux/kernel/sys.c
204 sys_setregid linux/kernel/sys.c
205 sys_getgroups linux/kernel/sys.c
206 sys_setgroups linux/kernel/sys.c
208 sys_setresuid linux/kernel/sys.c
209 sys_getresuid linux/kernel/sys.c
210 sys_setresgid linux/kernel/sys.c
211 sys_getresgid linux/kernel/sys.c
213 sys_setuid linux/kernel/sys.c
214 sys_setgid linux/kernel/sys.c
215 sys_setfsuid linux/kernel/sys.c
216 sys_setfsgid linux/kernel/sys.c
149 sys_sysctl linux/kernel/sysctl.c
Time
13 sys_time linux/kernel/time.c
25 sys_stime linux/kernel/time.c
78 sys_gettimeofday linux/kernel/time.c
79 sys_settimeofday linux/kernel/time.c
124 sys_adjtimex linux/kernel/time.c
Kernel Timer & Process
20 sys_getpid linux/kernel/timer.c
27 sys_alarm linux/kernel/timer.c
64 sys_getppid linux/kernel/timer.c
116 sys_sysinfo linux/kernel/timer.c
199 sys_getuid linux/kernel/timer.c
200 sys_getgid linux/kernel/timer.c
201 sys_geteuid linux/kernel/timer.c
202 sys_getegid linux/kernel/timer.c
224 sys_gettid linux/kernel/timer.c
16-bit uid (wrapper functions)
16 sys_lchown16 linux/kernel/uid16.c
23 sys_setuid16 linux/kernel/uid16.c
24 sys_getuid16 linux/kernel/uid16.c
46 sys_setgid16 linux/kernel/uid16.c
47 sys_getgid16 linux/kernel/uid16.c
49 sys_geteuid16 linux/kernel/uid16.c
50 sys_getegid16 linux/kernel/uid16.c
70 sys_setreuid16 linux/kernel/uid16.c
71 sys_setregid16 linux/kernel/uid16.c
80 sys_getgroups16 linux/kernel/uid16.c
81 sys_setgroups16 linux/kernel/uid16.c
95 sys_fchown16 linux/kernel/uid16.c
138 sys_setfsuid16 linux/kernel/uid16.c
139 sys_setfsgid16 linux/kernel/uid16.c
164 sys_setresuid16 linux/kernel/uid16.c
165 sys_getresuid16 linux/kernel/uid16.c
170 sys_setresgid16 linux/kernel/uid16.c
171 sys_getresgid16 linux/kernel/uid16.c
182 sys_chown16 linux/kernel/uid16.c
Memory Management
250 sys_fadvise64 linux/mm/fadvise.c
225 sys_readahead linux/mm/filemap.c
257 sys_remap_file_pages linux/mm/fremap.c
219 sys_madvise linux/mm/madvise.c
218 sys_mincore linux/mm/mincore.c
150 sys_mlock linux/mm/mlock.c
151 sys_munlock linux/mm/mlock.c
152 sys_mlockall linux/mm/mlock.c
153 sys_munlockall linux/mm/mlock.c
45 sys_brk linux/mm/mmap.c
91 sys_munmap linux/mm/mmap.c
125 sys_mprotect linux/mm/mprotect.c
163 sys_mremap linux/mm/mremap.c
144 sys_msync linux/mm/msync.c
Swapfile
87 sys_swapon linux/mm/swapfile.c
115 sys_swapoff linux/mm/swapfile.c
Socket
102 sys_socketcall linux/net/socket.c

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

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