github.com/jspc/eggos@v0.5.1-0.20221028160421-556c75c878a5/kernel/sysnum.go (about) 1 package kernel 2 3 // copy from https://github.com/lunixbochs/ghostrace/blob/a9d482a46185139ca37908b6ce98e4c5ef048791/ghost/sys/num/linux_x86_64_sys.go#L3 4 var sysnum = [...]string{ 5 0: "read", 6 1: "write", 7 2: "open", 8 3: "close", 9 4: "stat", 10 5: "fstat", 11 6: "lstat", 12 7: "poll", 13 8: "lseek", 14 9: "mmap", 15 10: "mprotect", 16 11: "munmap", 17 12: "brk", 18 13: "rt_sigaction", 19 14: "rt_sigprocmask", 20 15: "rt_sigreturn", 21 16: "ioctl", 22 17: "pread64", 23 18: "pwrite64", 24 19: "readv", 25 20: "writev", 26 21: "access", 27 22: "pipe", 28 23: "select", 29 24: "sched_yield", 30 25: "mremap", 31 26: "msync", 32 27: "mincore", 33 28: "madvise", 34 29: "shmget", 35 30: "shmat", 36 31: "shmctl", 37 32: "dup", 38 33: "dup2", 39 34: "pause", 40 35: "nanosleep", 41 36: "getitimer", 42 37: "alarm", 43 38: "setitimer", 44 39: "getpid", 45 40: "sendfile", 46 41: "socket", 47 42: "connect", 48 43: "accept", 49 44: "sendto", 50 45: "recvfrom", 51 46: "sendmsg", 52 47: "recvmsg", 53 48: "shutdown", 54 49: "bind", 55 50: "listen", 56 51: "getsockname", 57 52: "getpeername", 58 53: "socketpair", 59 54: "setsockopt", 60 55: "getsockopt", 61 56: "clone", 62 57: "fork", 63 58: "vfork", 64 59: "execve", 65 60: "exit", 66 61: "wait4", 67 62: "kill", 68 63: "uname", 69 64: "semget", 70 65: "semop", 71 66: "semctl", 72 67: "shmdt", 73 68: "msgget", 74 69: "msgsnd", 75 70: "msgrcv", 76 71: "msgctl", 77 72: "fcntl", 78 73: "flock", 79 74: "fsync", 80 75: "fdatasync", 81 76: "truncate", 82 77: "ftruncate", 83 78: "getdents", 84 79: "getcwd", 85 80: "chdir", 86 81: "fchdir", 87 82: "rename", 88 83: "mkdir", 89 84: "rmdir", 90 85: "creat", 91 86: "link", 92 87: "unlink", 93 88: "symlink", 94 89: "readlink", 95 90: "chmod", 96 91: "fchmod", 97 92: "chown", 98 93: "fchown", 99 94: "lchown", 100 95: "umask", 101 96: "gettimeofday", 102 97: "getrlimit", 103 98: "getrusage", 104 99: "sysinfo", 105 100: "times", 106 101: "ptrace", 107 102: "getuid", 108 103: "syslog", 109 104: "getgid", 110 105: "setuid", 111 106: "setgid", 112 107: "geteuid", 113 108: "getegid", 114 109: "setpgid", 115 110: "getppid", 116 111: "getpgrp", 117 112: "setsid", 118 113: "setreuid", 119 114: "setregid", 120 115: "getgroups", 121 116: "setgroups", 122 117: "setresuid", 123 118: "getresuid", 124 119: "setresgid", 125 120: "getresgid", 126 121: "getpgid", 127 122: "setfsuid", 128 123: "setfsgid", 129 124: "getsid", 130 125: "capget", 131 126: "capset", 132 127: "rt_sigpending", 133 128: "rt_sigtimedwait", 134 129: "rt_sigqueueinfo", 135 130: "rt_sigsuspend", 136 131: "sigaltstack", 137 132: "utime", 138 133: "mknod", 139 134: "uselib", 140 135: "personality", 141 136: "ustat", 142 137: "statfs", 143 138: "fstatfs", 144 139: "sysfs", 145 140: "getpriority", 146 141: "setpriority", 147 142: "sched_setparam", 148 143: "sched_getparam", 149 144: "sched_setscheduler", 150 145: "sched_getscheduler", 151 146: "sched_get_priority_max", 152 147: "sched_get_priority_min", 153 148: "sched_rr_get_interval", 154 149: "mlock", 155 150: "munlock", 156 151: "mlockall", 157 152: "munlockall", 158 153: "vhangup", 159 154: "modify_ldt", 160 155: "pivot_root", 161 156: "_sysctl", 162 157: "prctl", 163 158: "arch_prctl", 164 159: "adjtimex", 165 160: "setrlimit", 166 161: "chroot", 167 162: "sync", 168 163: "acct", 169 164: "settimeofday", 170 165: "mount", 171 166: "umount2", 172 167: "swapon", 173 168: "swapoff", 174 169: "reboot", 175 170: "sethostname", 176 171: "setdomainname", 177 172: "iopl", 178 173: "ioperm", 179 174: "create_module", 180 175: "init_module", 181 176: "delete_module", 182 177: "get_kernel_syms", 183 178: "query_module", 184 179: "quotactl", 185 180: "nfsservctl", 186 181: "getpmsg", 187 182: "putpmsg", 188 183: "afs_syscall", 189 184: "tuxcall", 190 185: "security", 191 186: "gettid", 192 187: "readahead", 193 188: "setxattr", 194 189: "lsetxattr", 195 190: "fsetxattr", 196 191: "getxattr", 197 192: "lgetxattr", 198 193: "fgetxattr", 199 194: "listxattr", 200 195: "llistxattr", 201 196: "flistxattr", 202 197: "removexattr", 203 198: "lremovexattr", 204 199: "fremovexattr", 205 200: "tkill", 206 201: "time", 207 202: "futex", 208 203: "sched_setaffinity", 209 204: "sched_getaffinity", 210 205: "set_thread_area", 211 206: "io_setup", 212 207: "io_destroy", 213 208: "io_getevents", 214 209: "io_submit", 215 210: "io_cancel", 216 211: "get_thread_area", 217 212: "lookup_dcookie", 218 213: "epoll_create", 219 214: "epoll_ctl_old", 220 215: "epoll_wait_old", 221 216: "remap_file_pages", 222 217: "getdents64", 223 218: "set_tid_address", 224 219: "restart_syscall", 225 220: "semtimedop", 226 221: "fadvise64", 227 222: "timer_create", 228 223: "timer_settime", 229 224: "timer_gettime", 230 225: "timer_getoverrun", 231 226: "timer_delete", 232 227: "clock_settime", 233 228: "clock_gettime", 234 229: "clock_getres", 235 230: "clock_nanosleep", 236 231: "exit_group", 237 232: "epoll_wait", 238 233: "epoll_ctl", 239 234: "tgkill", 240 235: "utimes", 241 236: "vserver", 242 237: "mbind", 243 238: "set_mempolicy", 244 239: "get_mempolicy", 245 240: "mq_open", 246 241: "mq_unlink", 247 242: "mq_timedsend", 248 243: "mq_timedreceive", 249 244: "mq_notify", 250 245: "mq_getsetattr", 251 246: "kexec_load", 252 247: "waitid", 253 248: "add_key", 254 249: "request_key", 255 250: "keyctl", 256 251: "ioprio_set", 257 252: "ioprio_get", 258 253: "inotify_init", 259 254: "inotify_add_watch", 260 255: "inotify_rm_watch", 261 256: "migrate_pages", 262 257: "openat", 263 258: "mkdirat", 264 259: "mknodat", 265 260: "fchownat", 266 261: "futimesat", 267 262: "newfstatat", 268 263: "unlinkat", 269 264: "renameat", 270 265: "linkat", 271 266: "symlinkat", 272 267: "readlinkat", 273 268: "fchmodat", 274 269: "faccessat", 275 270: "pselect6", 276 271: "ppoll", 277 272: "unshare", 278 273: "set_robust_list", 279 274: "get_robust_list", 280 275: "splice", 281 276: "tee", 282 277: "sync_file_range", 283 278: "vmsplice", 284 279: "move_pages", 285 280: "utimensat", 286 281: "epoll_pwait", 287 282: "signalfd", 288 283: "timerfd_create", 289 284: "eventfd", 290 285: "fallocate", 291 286: "timerfd_settime", 292 287: "timerfd_gettime", 293 288: "accept4", 294 289: "signalfd4", 295 290: "eventfd2", 296 291: "epoll_create1", 297 292: "dup3", 298 293: "pipe2", 299 294: "inotify_init1", 300 295: "preadv", 301 296: "pwritev", 302 297: "rt_tgsigqueueinfo", 303 298: "perf_event_open", 304 299: "recvmmsg", 305 300: "fanotify_init", 306 301: "fanotify_mark", 307 302: "prlimit64", 308 303: "name_to_handle_at", 309 304: "open_by_handle_at", 310 305: "clock_adjtime", 311 306: "syncfs", 312 307: "sendmmsg", 313 308: "setns", 314 309: "getcpu", 315 310: "process_vm_readv", 316 311: "process_vm_writev", 317 312: "kcmp", 318 313: "finit_module", 319 } 320 321 //go:nosplit 322 func syscallName(n int) string { 323 if n >= len(sysnum) { 324 return "unknown" 325 } 326 return sysnum[n] 327 }