syscall.h (3154B)
1 /* -*-comment-start: "//";comment-end:""-*- 2 * GNU Mes --- Maxwell Equations of Software 3 * Copyright © 2017,2022,2024 Janneke Nieuwenhuizen <janneke@gnu.org> 4 * 5 * This file is part of GNU Mes. 6 * 7 * GNU Mes is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License, or (at 10 * your option) any later version. 11 * 12 * GNU Mes is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 /* Commentary: 21 * See https://github.com/torvalds/linux/blob/v4.19/arch/x86/entry/syscalls/syscall_32.tbl 22 * https://github.com/torvalds/linux/raw/v4.19/arch/x86/entry/syscalls/syscall_32.tbl 23 * 24 * Code: 25 */ 26 #ifndef __MES_LINUX_X86_SYSCALL_H 27 #define __MES_LINUX_X86_SYSCALL_H 1 28 29 /* libc-mini */ 30 #ifndef SYS_exit 31 #define SYS_exit 0x01 32 #endif 33 #ifndef SYS_write 34 #define SYS_write 0x04 35 #endif 36 37 /* libc */ 38 #define SYS_fork 0x02 39 #define SYS_read 0x03 40 #define SYS_open 0x05 41 #define SYS_waitpid 0x07 42 #define SYS_wait4 0x72 43 #define SYS_execve 0x0b 44 #define SYS_chmod 0x0f 45 #define SYS_access 0x21 46 #define SYS_brk 0x2d 47 #define SYS_ioctl 0x36 48 #define SYS_fsync 0x76 49 #define SYS_getcwd 0xb7 50 #define SYS_dup 0x29 51 #define SYS_dup2 0x3f 52 #define SYS_unlink 0x0a 53 #define SYS_gettimeofday 0x4e 54 #define SYS_clock_gettime 0x109 55 #define SYS_time 0x0d 56 #define SYS_newuname 0x7a 57 58 /* libc+tcc */ 59 #define SYS_close 0x06 60 #define SYS_lseek 0x13 61 #define SYS_rmdir 0x28 62 #define SYS_stat 0x6a 63 64 /* libc+gnu */ 65 #define SYS_chdir 0x0c 66 #define SYS_link 0x09 67 #define SYS_getpid 0x14 68 #define SYS_getuid 0x18 69 #define SYS_kill 0x25 70 #define SYS_rename 0x26 71 #define SYS_mkdir 0x27 72 #define SYS_pipe 0x2a 73 #define SYS_getgid 0x2f 74 #define SYS_signal 0x30 75 #define SYS_sigaction 0x43 76 #define SYS_rt_sigaction 0xae 77 #define SYS_signal 0x30 78 #define SYS_fcntl 0x37 79 #define SYS_getrusage 0x4d 80 #define SYS_lstat 0x6b 81 #define SYS_setitimer 0x68 82 #define SYS_fstat 0x6c 83 #define SYS_nanosleep 0xa2 84 #define SYS_getdents 0x8d 85 86 /* bash */ 87 #define SYS_setuid 0x17 88 #define SYS_geteuid 0x31 89 #define SYS_getegid 0x32 90 #define SYS_setgid 0x3e 91 #define SYS_getppid 0x40 92 93 /* make+POSIX */ 94 #define SYS_sigprocmask 0x7e 95 96 /* tar */ 97 #define SYS_symlink 0x53 98 #define SYS_readlink 0x55 99 #define SYS_mknod 0x0e 100 101 /* gash */ 102 #define SYS_umask 0x3c 103 #define SYS_utimensat 0x140 104 105 #if __SIZEOF_LONG_LONG__ == 8 106 107 #define SYS_stat64 0xc3 108 #define SYS_lstat64 0xc4 109 #define SYS_fstat64 0xc5 110 #define SYS_fcntl64 0xdd 111 #define SYS_getdents64 0xdc 112 113 #undef SYS_stat 114 #define SYS_stat SYS_stat64 115 116 #undef SYS_lstat 117 #define SYS_lstat SYS_lstat64 118 119 #undef SYS_fstat 120 #define SYS_fstat SYS_fstat64 121 122 #endif // __SIZEOF_LONG_LONG__ == 8 123 124 #endif /* __MES_LINUX_X86_SYSCALL_H */