1 pub const SYS_READ: usize = 0; 2 pub const SYS_WRITE: usize = 1; 3 pub const SYS_OPEN: usize = 2; 4 pub const SYS_CLOSE: usize = 3; 5 6 pub const SYS_FSTAT: usize = 5; 7 pub const SYS_LSEEK: usize = 8; 8 pub const SYS_MMAP: usize = 9; 9 pub const SYS_MPROTECT: usize = 10; 10 pub const SYS_MUNMAP: usize = 11; 11 pub const SYS_BRK: usize = 12; 12 pub const SYS_SIGACTION: usize = 13; 13 14 pub const SYS_RT_SIGRETURN: usize = 15; 15 16 pub const SYS_WRITEV: usize = 20; 17 18 pub const SYS_DUP: usize = 32; 19 pub const SYS_DUP2: usize = 33; 20 21 pub const SYS_NANOSLEEP: usize = 35; 22 23 pub const SYS_GETPID: usize = 39; 24 25 pub const SYS_SOCKET: usize = 41; 26 pub const SYS_CONNECT: usize = 42; 27 pub const SYS_ACCEPT: usize = 43; 28 pub const SYS_SENDTO: usize = 44; 29 pub const SYS_RECVFROM: usize = 45; 30 31 pub const SYS_RECVMSG: usize = 47; 32 pub const SYS_SHUTDOWN: usize = 48; 33 pub const SYS_BIND: usize = 49; 34 pub const SYS_LISTEN: usize = 50; 35 pub const SYS_GETSOCKNAME: usize = 51; 36 pub const SYS_GETPEERNAME: usize = 52; 37 38 pub const SYS_SETSOCKOPT: usize = 54; 39 pub const SYS_GETSOCKOPT: usize = 55; 40 pub const SYS_CLONE: usize = 56; 41 pub const SYS_FORK: usize = 57; 42 pub const SYS_VFORK: usize = 58; 43 pub const SYS_EXECVE: usize = 59; 44 pub const SYS_EXIT: usize = 60; 45 pub const SYS_WAIT4: usize = 61; 46 pub const SYS_KILL: usize = 62; 47 48 pub const SYS_FCNTL: usize = 72; 49 50 pub const SYS_FTRUNCATE: usize = 77; 51 pub const SYS_GET_DENTS: usize = 78; 52 53 pub const SYS_GETCWD: usize = 79; 54 55 pub const SYS_CHDIR: usize = 80; 56 57 pub const SYS_MKDIR: usize = 83; 58 59 pub const SYS_GETTIMEOFDAY: usize = 96; 60 61 pub const SYS_REBOOT: usize = 169; 62 63 pub const SYS_GETPPID: usize = 110; 64 pub const SYS_GETPGID: usize = 121; 65 66 pub const SYS_MKNOD: usize = 133; 67 68 pub const SYS_ARCH_PRCTL: usize = 158; 69 70 pub const SYS_FUTEX: usize = 202; 71 72 pub const SYS_SET_TID_ADDR: usize = 218; 73 74 pub const SYS_UNLINK_AT: usize = 263; 75 76 pub const SYS_PIPE: usize = 293; 77 78 // 与linux不一致的调用,在linux基础上累加 79 // 独立系统调用号大于100000 80 pub const SYS_PUT_STRING: usize = 100000; 81 82 // TODO: 和linux不一致 83 pub const SYS_SBRK: usize = 100001; 84 85 /// todo: 该系统调用与Linux不一致,将来需要删除该系统调用!!! 删的时候记得改C版本的libc 86 pub const SYS_CLOCK: usize = 100002; 87 pub const SYS_SCHED: usize = 100003; 88