mes/include/linux/SYSCALLS
Jan (janneke) Nieuwenhuizen 9ae3426c96 lib: Document syscalls.
* include/linux/SYSCALLS: New file.
2023-11-05 09:39:29 +01:00

112 lines
6.2 KiB
Org Mode

#+COMMENT: -*- org -*-
#+TITLE: Linux System Calls
|---------------+----------+-----+--------+-----+---------|
| name | old | x86 | x86_64 | arm | riscv64 |
|---------------+----------+-----+--------+-----+---------|
| libc-mini | | | | | |
|---------------+----------+-----+--------+-----+---------|
| exit | | 1 | 60 | 1 | 1 |
| write | | 4 | 1 | 4 | 4 |
|---------------+----------+-----+--------+-----+---------|
| libc | | | | | |
|---------------+----------+-----+--------+-----+---------|
| fork | | 2 | 57 | 2 | 2 |
| read | | 3 | 0 | 3 | 3 |
| open | | 5 | 2 | 5 | 5 |
| waitpid | | 7 | | | |
| wait4 | waitpid | 114 | 61 | 114 | 114 |
| execve | | 11 | 59 | 11 | 11 |
| chmod | | 15 | 90 | 15 | 15 |
| access | | 33 | 21 | 33 | 33 |
| brk | | 45 | 12 | 45 | 45 |
| ioctl | | 54 | 16 | 54 | 54 |
| fsync | | 118 | 74 | 118 | 118 |
| getcwd | | 183 | 79 | 183 | 183 |
| dup | | 41 | 32 | 41 | 41 |
| dup2 | | 63 | 33 | 63 | 63 |
| unlink | | 10 | 87 | 10 | 10 |
| gettimeofday | time | 78 | 96 | 78 | 78 |
| clock_gettime | | 265 | 228 | 263 | 260 |
| time | | 13 | 201 | 13 | |
|---------------+----------+-----+--------+-----+---------|
| libc+tcc | | | | | |
|---------------+----------+-----+--------+-----+---------|
| close | | 6 | 3 | 6 | 6 |
| lseek | | 19 | 8 | 19 | 19 |
| rmdir | | 40 | 84 | 40 | 40 |
| stat | | 106 | 4 | 106 | 106 |
|---------------+----------+-----+--------+-----+---------|
| libc+GNU | | | | | |
|---------------+----------+-----+--------+-----+---------|
| chdir | | 12 | 80 | 12 | 12 |
| link | | 9 | 86 | 9 | 9 |
| getpid | | 20 | 39 | 20 | 20 |
| getuid | | 24 | 102 | 24 | 199 |
| kill | | 37 | 62 | 37 | 37 |
| rename | | 38 | 82 | 38 | 38 |
| mkdir | | 39 | 83 | 39 | 39 |
| pipe | | 42 | 22 | 42 | 42 |
| getgid | | 47 | 104 | 47 | 200 |
| signal | | 48 | | | 48 |
| sigaction | | 67 | | 67 | 67 |
| rt_sigaction | | 174 | 13 | 174 | 174 |
| signal | | 48 | | | 48 |
| fcntl | | 55 | 72 | 55 | 55 |
| getrusage | | 77 | 98 | 77 | 77 |
| lstat | | 107 | 6 | 107 | 107 |
| setitimer | | 104 | 38 | 104 | 104 |
| fstat | | 108 | 5 | 108 | 108 |
| nanosleep | | 162 | 35 | 162 | 162 |
| getdents | | 141 | 78 | 141 | 141 |
|---------------+----------+-----+--------+-----+---------|
| GNU+bash | | | | | |
|---------------+----------+-----+--------+-----+---------|
| setuid | | 23 | 105 | 23 | 213 |
| geteuid | | 49 | 107 | 49 | 201 |
| getegid | | 50 | 108 | 50 | 202 |
| setgid | | 46 | 106 | 46 | 214 |
| getppid | | 64 | 110 | 64 | 64 |
|---------------+----------+-----+--------+-----+---------|
| GNU+make | | | | | |
|---------------+----------+-----+--------+-----+---------|
| sigprocmask | | 126 | | 126 | 126 |
|---------------+----------+-----+--------+-----+---------|
| GNU+tar | | | | | |
|---------------+----------+-----+--------+-----+---------|
| symlink | | 83 | 88 | 83 | 83 |
| readlink | | 85 | 89 | 85 | 85 |
| mknod | | 14 | 133 | 14 | 14 |
|---------------+----------+-----+--------+-----+---------|
| new | | | | | |
|---------------+----------+-----+--------+-----+---------|
| clone | fork | 120 | 56 | 120 | 120 |
| getdents64 | getdents | 220 | 217 | 217 | 220 |
| openat | open | 295 | 257 | 322 | 288 |
| mkdirat | mkdir | 296 | 258 | 323 | 289 |
| mknodat | mknod | 297 | 259 | 324 | 290 |
| unlinkat | rmdir | 301 | 263 | 328 | 294 |
| unlinkat | unlink | 301 | 263 | 328 | 294 |
| renameat | rename | 302 | 264 | 329 | 295 |
| linkat | link | 303 | 265 | 330 | 296 |
| symlinkat | symlink | 304 | 266 | 331 | 297 |
| readlinkat | readlink | 305 | 267 | 332 | 298 |
| fchmodat | chmod | 306 | 268 | 333 | 299 |
| faccessat | access | 307 | 269 | 334 | 300 |
| dup3 | dup2 | 330 | 292 | 358 | 326 |
| pipe2 | pipe | 331 | 293 | 359 | 325 |
|---------------+----------+-----+--------+-----+---------|
* Sources
https://github.com/torvalds/linux/blob/v4.19/arch/arm/tools/syscall.tbl
https://github.com/torvalds/linux/blob/v4.19/arch/x86/entry/syscalls/syscall_32.tbl
https://github.com/torvalds/linux/blob/v4.19/arch/x86/entry/syscalls/syscall_64.tbl
* Legalese
Copyright © 2022 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.