From 63409cf422c71fee64c55f2b77999ee94366400f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 2 Mar 2020 23:30:53 +1100 Subject: [PATCH] std: linux syscall numbers are now an extensible enum --- lib/std/os.zig | 2 +- lib/std/os/bits/linux/arm-eabi.zig | 802 +++++++++--------- lib/std/os/bits/linux/arm64.zig | 589 +++++++------- lib/std/os/bits/linux/i386.zig | 854 ++++++++++---------- lib/std/os/bits/linux/mipsel.zig | 747 ++++++++--------- lib/std/os/bits/linux/riscv64.zig | 592 +++++++------- lib/std/os/bits/linux/x86_64.zig | 704 ++++++++-------- lib/std/os/linux.zig | 454 +++++------ lib/std/os/linux/arm-eabi.zig | 32 +- lib/std/os/linux/arm64.zig | 30 +- lib/std/os/linux/i386.zig | 34 +- lib/std/os/linux/mipsel.zig | 34 +- lib/std/os/linux/riscv64.zig | 30 +- lib/std/os/linux/tls.zig | 8 +- lib/std/os/linux/x86_64.zig | 30 +- lib/std/special/compiler_rt/clear_cache.zig | 2 +- 16 files changed, 2484 insertions(+), 2460 deletions(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index f1184094db..e9e3b449f2 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2065,7 +2065,7 @@ pub fn isatty(handle: fd_t) bool { } if (builtin.os.tag == .linux) { var wsz: linux.winsize = undefined; - return linux.syscall3(linux.SYS_ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0; + return linux.syscall3(.ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0; } unreachable; } diff --git a/lib/std/os/bits/linux/arm-eabi.zig b/lib/std/os/bits/linux/arm-eabi.zig index 1824263fa4..7dd6941b5b 100644 --- a/lib/std/os/bits/linux/arm-eabi.zig +++ b/lib/std/os/bits/linux/arm-eabi.zig @@ -9,406 +9,410 @@ const sigset_t = linux.sigset_t; const uid_t = linux.uid_t; const gid_t = linux.gid_t; -pub const SYS_restart_syscall = 0; -pub const SYS_exit = 1; -pub const SYS_fork = 2; -pub const SYS_read = 3; -pub const SYS_write = 4; -pub const SYS_open = 5; -pub const SYS_close = 6; -pub const SYS_creat = 8; -pub const SYS_link = 9; -pub const SYS_unlink = 10; -pub const SYS_execve = 11; -pub const SYS_chdir = 12; -pub const SYS_mknod = 14; -pub const SYS_chmod = 15; -pub const SYS_lchown = 16; -pub const SYS_lseek = 19; -pub const SYS_getpid = 20; -pub const SYS_mount = 21; -pub const SYS_setuid = 23; -pub const SYS_getuid = 24; -pub const SYS_ptrace = 26; -pub const SYS_pause = 29; -pub const SYS_access = 33; -pub const SYS_nice = 34; -pub const SYS_sync = 36; -pub const SYS_kill = 37; -pub const SYS_rename = 38; -pub const SYS_mkdir = 39; -pub const SYS_rmdir = 40; -pub const SYS_dup = 41; -pub const SYS_pipe = 42; -pub const SYS_times = 43; -pub const SYS_brk = 45; -pub const SYS_setgid = 46; -pub const SYS_getgid = 47; -pub const SYS_geteuid = 49; -pub const SYS_getegid = 50; -pub const SYS_acct = 51; -pub const SYS_umount2 = 52; -pub const SYS_ioctl = 54; -pub const SYS_fcntl = 55; -pub const SYS_setpgid = 57; -pub const SYS_umask = 60; -pub const SYS_chroot = 61; -pub const SYS_ustat = 62; -pub const SYS_dup2 = 63; -pub const SYS_getppid = 64; -pub const SYS_getpgrp = 65; -pub const SYS_setsid = 66; -pub const SYS_sigaction = 67; -pub const SYS_setreuid = 70; -pub const SYS_setregid = 71; -pub const SYS_sigsuspend = 72; -pub const SYS_sigpending = 73; -pub const SYS_sethostname = 74; -pub const SYS_setrlimit = 75; -pub const SYS_getrusage = 77; -pub const SYS_gettimeofday = 78; -pub const SYS_settimeofday = 79; -pub const SYS_getgroups = 80; -pub const SYS_setgroups = 81; -pub const SYS_symlink = 83; -pub const SYS_readlink = 85; -pub const SYS_uselib = 86; -pub const SYS_swapon = 87; -pub const SYS_reboot = 88; -pub const SYS_munmap = 91; -pub const SYS_truncate = 92; -pub const SYS_ftruncate = 93; -pub const SYS_fchmod = 94; -pub const SYS_fchown = 95; -pub const SYS_getpriority = 96; -pub const SYS_setpriority = 97; -pub const SYS_statfs = 99; -pub const SYS_fstatfs = 100; -pub const SYS_syslog = 103; -pub const SYS_setitimer = 104; -pub const SYS_getitimer = 105; -pub const SYS_stat = 106; -pub const SYS_lstat = 107; -pub const SYS_fstat = 108; -pub const SYS_vhangup = 111; -pub const SYS_wait4 = 114; -pub const SYS_swapoff = 115; -pub const SYS_sysinfo = 116; -pub const SYS_fsync = 118; -pub const SYS_sigreturn = 119; -pub const SYS_clone = 120; -pub const SYS_setdomainname = 121; -pub const SYS_uname = 122; -pub const SYS_adjtimex = 124; -pub const SYS_mprotect = 125; -pub const SYS_sigprocmask = 126; -pub const SYS_init_module = 128; -pub const SYS_delete_module = 129; -pub const SYS_quotactl = 131; -pub const SYS_getpgid = 132; -pub const SYS_fchdir = 133; -pub const SYS_bdflush = 134; -pub const SYS_sysfs = 135; -pub const SYS_personality = 136; -pub const SYS_setfsuid = 138; -pub const SYS_setfsgid = 139; -pub const SYS__llseek = 140; -pub const SYS_getdents = 141; -pub const SYS__newselect = 142; -pub const SYS_flock = 143; -pub const SYS_msync = 144; -pub const SYS_readv = 145; -pub const SYS_writev = 146; -pub const SYS_getsid = 147; -pub const SYS_fdatasync = 148; -pub const SYS__sysctl = 149; -pub const SYS_mlock = 150; -pub const SYS_munlock = 151; -pub const SYS_mlockall = 152; -pub const SYS_munlockall = 153; -pub const SYS_sched_setparam = 154; -pub const SYS_sched_getparam = 155; -pub const SYS_sched_setscheduler = 156; -pub const SYS_sched_getscheduler = 157; -pub const SYS_sched_yield = 158; -pub const SYS_sched_get_priority_max = 159; -pub const SYS_sched_get_priority_min = 160; -pub const SYS_sched_rr_get_interval = 161; -pub const SYS_nanosleep = 162; -pub const SYS_mremap = 163; -pub const SYS_setresuid = 164; -pub const SYS_getresuid = 165; -pub const SYS_poll = 168; -pub const SYS_nfsservctl = 169; -pub const SYS_setresgid = 170; -pub const SYS_getresgid = 171; -pub const SYS_prctl = 172; -pub const SYS_rt_sigreturn = 173; -pub const SYS_rt_sigaction = 174; -pub const SYS_rt_sigprocmask = 175; -pub const SYS_rt_sigpending = 176; -pub const SYS_rt_sigtimedwait = 177; -pub const SYS_rt_sigqueueinfo = 178; -pub const SYS_rt_sigsuspend = 179; -pub const SYS_pread64 = 180; -pub const SYS_pwrite64 = 181; -pub const SYS_chown = 182; -pub const SYS_getcwd = 183; -pub const SYS_capget = 184; -pub const SYS_capset = 185; -pub const SYS_sigaltstack = 186; -pub const SYS_sendfile = 187; -pub const SYS_vfork = 190; -pub const SYS_ugetrlimit = 191; -pub const SYS_mmap2 = 192; -pub const SYS_truncate64 = 193; -pub const SYS_ftruncate64 = 194; -pub const SYS_stat64 = 195; -pub const SYS_lstat64 = 196; -pub const SYS_fstat64 = 197; -pub const SYS_lchown32 = 198; -pub const SYS_getuid32 = 199; -pub const SYS_getgid32 = 200; -pub const SYS_geteuid32 = 201; -pub const SYS_getegid32 = 202; -pub const SYS_setreuid32 = 203; -pub const SYS_setregid32 = 204; -pub const SYS_getgroups32 = 205; -pub const SYS_setgroups32 = 206; -pub const SYS_fchown32 = 207; -pub const SYS_setresuid32 = 208; -pub const SYS_getresuid32 = 209; -pub const SYS_setresgid32 = 210; -pub const SYS_getresgid32 = 211; -pub const SYS_chown32 = 212; -pub const SYS_setuid32 = 213; -pub const SYS_setgid32 = 214; -pub const SYS_setfsuid32 = 215; -pub const SYS_setfsgid32 = 216; -pub const SYS_getdents64 = 217; -pub const SYS_pivot_root = 218; -pub const SYS_mincore = 219; -pub const SYS_madvise = 220; -pub const SYS_fcntl64 = 221; -pub const SYS_gettid = 224; -pub const SYS_readahead = 225; -pub const SYS_setxattr = 226; -pub const SYS_lsetxattr = 227; -pub const SYS_fsetxattr = 228; -pub const SYS_getxattr = 229; -pub const SYS_lgetxattr = 230; -pub const SYS_fgetxattr = 231; -pub const SYS_listxattr = 232; -pub const SYS_llistxattr = 233; -pub const SYS_flistxattr = 234; -pub const SYS_removexattr = 235; -pub const SYS_lremovexattr = 236; -pub const SYS_fremovexattr = 237; -pub const SYS_tkill = 238; -pub const SYS_sendfile64 = 239; -pub const SYS_futex = 240; -pub const SYS_sched_setaffinity = 241; -pub const SYS_sched_getaffinity = 242; -pub const SYS_io_setup = 243; -pub const SYS_io_destroy = 244; -pub const SYS_io_getevents = 245; -pub const SYS_io_submit = 246; -pub const SYS_io_cancel = 247; -pub const SYS_exit_group = 248; -pub const SYS_lookup_dcookie = 249; -pub const SYS_epoll_create = 250; -pub const SYS_epoll_ctl = 251; -pub const SYS_epoll_wait = 252; -pub const SYS_remap_file_pages = 253; -pub const SYS_set_tid_address = 256; -pub const SYS_timer_create = 257; -pub const SYS_timer_settime = 258; -pub const SYS_timer_gettime = 259; -pub const SYS_timer_getoverrun = 260; -pub const SYS_timer_delete = 261; -pub const SYS_clock_settime = 262; -pub const SYS_clock_gettime = 263; -pub const SYS_clock_getres = 264; -pub const SYS_clock_nanosleep = 265; -pub const SYS_statfs64 = 266; -pub const SYS_fstatfs64 = 267; -pub const SYS_tgkill = 268; -pub const SYS_utimes = 269; -pub const SYS_fadvise64_64 = 270; -pub const SYS_arm_fadvise64_64 = 270; -pub const SYS_pciconfig_iobase = 271; -pub const SYS_pciconfig_read = 272; -pub const SYS_pciconfig_write = 273; -pub const SYS_mq_open = 274; -pub const SYS_mq_unlink = 275; -pub const SYS_mq_timedsend = 276; -pub const SYS_mq_timedreceive = 277; -pub const SYS_mq_notify = 278; -pub const SYS_mq_getsetattr = 279; -pub const SYS_waitid = 280; -pub const SYS_socket = 281; -pub const SYS_bind = 282; -pub const SYS_connect = 283; -pub const SYS_listen = 284; -pub const SYS_accept = 285; -pub const SYS_getsockname = 286; -pub const SYS_getpeername = 287; -pub const SYS_socketpair = 288; -pub const SYS_send = 289; -pub const SYS_sendto = 290; -pub const SYS_recv = 291; -pub const SYS_recvfrom = 292; -pub const SYS_shutdown = 293; -pub const SYS_setsockopt = 294; -pub const SYS_getsockopt = 295; -pub const SYS_sendmsg = 296; -pub const SYS_recvmsg = 297; -pub const SYS_semop = 298; -pub const SYS_semget = 299; -pub const SYS_semctl = 300; -pub const SYS_msgsnd = 301; -pub const SYS_msgrcv = 302; -pub const SYS_msgget = 303; -pub const SYS_msgctl = 304; -pub const SYS_shmat = 305; -pub const SYS_shmdt = 306; -pub const SYS_shmget = 307; -pub const SYS_shmctl = 308; -pub const SYS_add_key = 309; -pub const SYS_request_key = 310; -pub const SYS_keyctl = 311; -pub const SYS_semtimedop = 312; -pub const SYS_vserver = 313; -pub const SYS_ioprio_set = 314; -pub const SYS_ioprio_get = 315; -pub const SYS_inotify_init = 316; -pub const SYS_inotify_add_watch = 317; -pub const SYS_inotify_rm_watch = 318; -pub const SYS_mbind = 319; -pub const SYS_get_mempolicy = 320; -pub const SYS_set_mempolicy = 321; -pub const SYS_openat = 322; -pub const SYS_mkdirat = 323; -pub const SYS_mknodat = 324; -pub const SYS_fchownat = 325; -pub const SYS_futimesat = 326; -pub const SYS_fstatat64 = 327; -pub const SYS_unlinkat = 328; -pub const SYS_renameat = 329; -pub const SYS_linkat = 330; -pub const SYS_symlinkat = 331; -pub const SYS_readlinkat = 332; -pub const SYS_fchmodat = 333; -pub const SYS_faccessat = 334; -pub const SYS_pselect6 = 335; -pub const SYS_ppoll = 336; -pub const SYS_unshare = 337; -pub const SYS_set_robust_list = 338; -pub const SYS_get_robust_list = 339; -pub const SYS_splice = 340; -pub const SYS_sync_file_range2 = 341; -pub const SYS_arm_sync_file_range = 341; -pub const SYS_tee = 342; -pub const SYS_vmsplice = 343; -pub const SYS_move_pages = 344; -pub const SYS_getcpu = 345; -pub const SYS_epoll_pwait = 346; -pub const SYS_kexec_load = 347; -pub const SYS_utimensat = 348; -pub const SYS_signalfd = 349; -pub const SYS_timerfd_create = 350; -pub const SYS_eventfd = 351; -pub const SYS_fallocate = 352; -pub const SYS_timerfd_settime = 353; -pub const SYS_timerfd_gettime = 354; -pub const SYS_signalfd4 = 355; -pub const SYS_eventfd2 = 356; -pub const SYS_epoll_create1 = 357; -pub const SYS_dup3 = 358; -pub const SYS_pipe2 = 359; -pub const SYS_inotify_init1 = 360; -pub const SYS_preadv = 361; -pub const SYS_pwritev = 362; -pub const SYS_rt_tgsigqueueinfo = 363; -pub const SYS_perf_event_open = 364; -pub const SYS_recvmmsg = 365; -pub const SYS_accept4 = 366; -pub const SYS_fanotify_init = 367; -pub const SYS_fanotify_mark = 368; -pub const SYS_prlimit64 = 369; -pub const SYS_name_to_handle_at = 370; -pub const SYS_open_by_handle_at = 371; -pub const SYS_clock_adjtime = 372; -pub const SYS_syncfs = 373; -pub const SYS_sendmmsg = 374; -pub const SYS_setns = 375; -pub const SYS_process_vm_readv = 376; -pub const SYS_process_vm_writev = 377; -pub const SYS_kcmp = 378; -pub const SYS_finit_module = 379; -pub const SYS_sched_setattr = 380; -pub const SYS_sched_getattr = 381; -pub const SYS_renameat2 = 382; -pub const SYS_seccomp = 383; -pub const SYS_getrandom = 384; -pub const SYS_memfd_create = 385; -pub const SYS_bpf = 386; -pub const SYS_execveat = 387; -pub const SYS_userfaultfd = 388; -pub const SYS_membarrier = 389; -pub const SYS_mlock2 = 390; -pub const SYS_copy_file_range = 391; -pub const SYS_preadv2 = 392; -pub const SYS_pwritev2 = 393; -pub const SYS_pkey_mprotect = 394; -pub const SYS_pkey_alloc = 395; -pub const SYS_pkey_free = 396; -pub const SYS_statx = 397; -pub const SYS_rseq = 398; -pub const SYS_io_pgetevents = 399; -pub const SYS_migrate_pages = 400; -pub const SYS_kexec_file_load = 401; -pub const SYS_clock_gettime64 = 403; -pub const SYS_clock_settime64 = 404; -pub const SYS_clock_adjtime64 = 405; -pub const SYS_clock_getres_time64 = 406; -pub const SYS_clock_nanosleep_time64 = 407; -pub const SYS_timer_gettime64 = 408; -pub const SYS_timer_settime64 = 409; -pub const SYS_timerfd_gettime64 = 410; -pub const SYS_timerfd_settime64 = 411; -pub const SYS_utimensat_time64 = 412; -pub const SYS_pselect6_time64 = 413; -pub const SYS_ppoll_time64 = 414; -pub const SYS_io_pgetevents_time64 = 416; -pub const SYS_recvmmsg_time64 = 417; -pub const SYS_mq_timedsend_time64 = 418; -pub const SYS_mq_timedreceive_time64 = 419; -pub const SYS_semtimedop_time64 = 420; -pub const SYS_rt_sigtimedwait_time64 = 421; -pub const SYS_futex_time64 = 422; -pub const SYS_sched_rr_get_interval_time64 = 423; -pub const SYS_pidfd_send_signal = 424; -pub const SYS_io_uring_setup = 425; -pub const SYS_io_uring_enter = 426; -pub const SYS_io_uring_register = 427; -pub const SYS_open_tree = 428; -pub const SYS_move_mount = 429; -pub const SYS_fsopen = 430; -pub const SYS_fsconfig = 431; -pub const SYS_fsmount = 432; -pub const SYS_fspick = 433; -pub const SYS_pidfd_open = 434; -pub const SYS_clone3 = 435; -pub const SYS_openat2 = 437; -pub const SYS_pidfd_getfd = 438; +pub const SYS = extern enum(usize) { + restart_syscall = 0, + exit = 1, + fork = 2, + read = 3, + write = 4, + open = 5, + close = 6, + creat = 8, + link = 9, + unlink = 10, + execve = 11, + chdir = 12, + mknod = 14, + chmod = 15, + lchown = 16, + lseek = 19, + getpid = 20, + mount = 21, + setuid = 23, + getuid = 24, + ptrace = 26, + pause = 29, + access = 33, + nice = 34, + sync = 36, + kill = 37, + rename = 38, + mkdir = 39, + rmdir = 40, + dup = 41, + pipe = 42, + times = 43, + brk = 45, + setgid = 46, + getgid = 47, + geteuid = 49, + getegid = 50, + acct = 51, + umount2 = 52, + ioctl = 54, + fcntl = 55, + setpgid = 57, + umask = 60, + chroot = 61, + ustat = 62, + dup2 = 63, + getppid = 64, + getpgrp = 65, + setsid = 66, + sigaction = 67, + setreuid = 70, + setregid = 71, + sigsuspend = 72, + sigpending = 73, + sethostname = 74, + setrlimit = 75, + getrusage = 77, + gettimeofday = 78, + settimeofday = 79, + getgroups = 80, + setgroups = 81, + symlink = 83, + readlink = 85, + uselib = 86, + swapon = 87, + reboot = 88, + munmap = 91, + truncate = 92, + ftruncate = 93, + fchmod = 94, + fchown = 95, + getpriority = 96, + setpriority = 97, + statfs = 99, + fstatfs = 100, + syslog = 103, + setitimer = 104, + getitimer = 105, + stat = 106, + lstat = 107, + fstat = 108, + vhangup = 111, + wait4 = 114, + swapoff = 115, + sysinfo = 116, + fsync = 118, + sigreturn = 119, + clone = 120, + setdomainname = 121, + uname = 122, + adjtimex = 124, + mprotect = 125, + sigprocmask = 126, + init_module = 128, + delete_module = 129, + quotactl = 131, + getpgid = 132, + fchdir = 133, + bdflush = 134, + sysfs = 135, + personality = 136, + setfsuid = 138, + setfsgid = 139, + _llseek = 140, + getdents = 141, + _newselect = 142, + flock = 143, + msync = 144, + readv = 145, + writev = 146, + getsid = 147, + fdatasync = 148, + _sysctl = 149, + mlock = 150, + munlock = 151, + mlockall = 152, + munlockall = 153, + sched_setparam = 154, + sched_getparam = 155, + sched_setscheduler = 156, + sched_getscheduler = 157, + sched_yield = 158, + sched_get_priority_max = 159, + sched_get_priority_min = 160, + sched_rr_get_interval = 161, + nanosleep = 162, + mremap = 163, + setresuid = 164, + getresuid = 165, + poll = 168, + nfsservctl = 169, + setresgid = 170, + getresgid = 171, + prctl = 172, + rt_sigreturn = 173, + rt_sigaction = 174, + rt_sigprocmask = 175, + rt_sigpending = 176, + rt_sigtimedwait = 177, + rt_sigqueueinfo = 178, + rt_sigsuspend = 179, + pread64 = 180, + pwrite64 = 181, + chown = 182, + getcwd = 183, + capget = 184, + capset = 185, + sigaltstack = 186, + sendfile = 187, + vfork = 190, + ugetrlimit = 191, + mmap2 = 192, + truncate64 = 193, + ftruncate64 = 194, + stat64 = 195, + lstat64 = 196, + fstat64 = 197, + lchown32 = 198, + getuid32 = 199, + getgid32 = 200, + geteuid32 = 201, + getegid32 = 202, + setreuid32 = 203, + setregid32 = 204, + getgroups32 = 205, + setgroups32 = 206, + fchown32 = 207, + setresuid32 = 208, + getresuid32 = 209, + setresgid32 = 210, + getresgid32 = 211, + chown32 = 212, + setuid32 = 213, + setgid32 = 214, + setfsuid32 = 215, + setfsgid32 = 216, + getdents64 = 217, + pivot_root = 218, + mincore = 219, + madvise = 220, + fcntl64 = 221, + gettid = 224, + readahead = 225, + setxattr = 226, + lsetxattr = 227, + fsetxattr = 228, + getxattr = 229, + lgetxattr = 230, + fgetxattr = 231, + listxattr = 232, + llistxattr = 233, + flistxattr = 234, + removexattr = 235, + lremovexattr = 236, + fremovexattr = 237, + tkill = 238, + sendfile64 = 239, + futex = 240, + sched_setaffinity = 241, + sched_getaffinity = 242, + io_setup = 243, + io_destroy = 244, + io_getevents = 245, + io_submit = 246, + io_cancel = 247, + exit_group = 248, + lookup_dcookie = 249, + epoll_create = 250, + epoll_ctl = 251, + epoll_wait = 252, + remap_file_pages = 253, + set_tid_address = 256, + timer_create = 257, + timer_settime = 258, + timer_gettime = 259, + timer_getoverrun = 260, + timer_delete = 261, + clock_settime = 262, + clock_gettime = 263, + clock_getres = 264, + clock_nanosleep = 265, + statfs64 = 266, + fstatfs64 = 267, + tgkill = 268, + utimes = 269, + fadvise64_64 = 270, + arm_fadvise64_64 = 270, + pciconfig_iobase = 271, + pciconfig_read = 272, + pciconfig_write = 273, + mq_open = 274, + mq_unlink = 275, + mq_timedsend = 276, + mq_timedreceive = 277, + mq_notify = 278, + mq_getsetattr = 279, + waitid = 280, + socket = 281, + bind = 282, + connect = 283, + listen = 284, + accept = 285, + getsockname = 286, + getpeername = 287, + socketpair = 288, + send = 289, + sendto = 290, + recv = 291, + recvfrom = 292, + shutdown = 293, + setsockopt = 294, + getsockopt = 295, + sendmsg = 296, + recvmsg = 297, + semop = 298, + semget = 299, + semctl = 300, + msgsnd = 301, + msgrcv = 302, + msgget = 303, + msgctl = 304, + shmat = 305, + shmdt = 306, + shmget = 307, + shmctl = 308, + add_key = 309, + request_key = 310, + keyctl = 311, + semtimedop = 312, + vserver = 313, + ioprio_set = 314, + ioprio_get = 315, + inotify_init = 316, + inotify_add_watch = 317, + inotify_rm_watch = 318, + mbind = 319, + get_mempolicy = 320, + set_mempolicy = 321, + openat = 322, + mkdirat = 323, + mknodat = 324, + fchownat = 325, + futimesat = 326, + fstatat64 = 327, + unlinkat = 328, + renameat = 329, + linkat = 330, + symlinkat = 331, + readlinkat = 332, + fchmodat = 333, + faccessat = 334, + pselect6 = 335, + ppoll = 336, + unshare = 337, + set_robust_list = 338, + get_robust_list = 339, + splice = 340, + sync_file_range2 = 341, + arm_sync_file_range = 341, + tee = 342, + vmsplice = 343, + move_pages = 344, + getcpu = 345, + epoll_pwait = 346, + kexec_load = 347, + utimensat = 348, + signalfd = 349, + timerfd_create = 350, + eventfd = 351, + fallocate = 352, + timerfd_settime = 353, + timerfd_gettime = 354, + signalfd4 = 355, + eventfd2 = 356, + epoll_create1 = 357, + dup3 = 358, + pipe2 = 359, + inotify_init1 = 360, + preadv = 361, + pwritev = 362, + rt_tgsigqueueinfo = 363, + perf_event_open = 364, + recvmmsg = 365, + accept4 = 366, + fanotify_init = 367, + fanotify_mark = 368, + prlimit64 = 369, + name_to_handle_at = 370, + open_by_handle_at = 371, + clock_adjtime = 372, + syncfs = 373, + sendmmsg = 374, + setns = 375, + process_vm_readv = 376, + process_vm_writev = 377, + kcmp = 378, + finit_module = 379, + sched_setattr = 380, + sched_getattr = 381, + renameat2 = 382, + seccomp = 383, + getrandom = 384, + memfd_create = 385, + bpf = 386, + execveat = 387, + userfaultfd = 388, + membarrier = 389, + mlock2 = 390, + copy_file_range = 391, + preadv2 = 392, + pwritev2 = 393, + pkey_mprotect = 394, + pkey_alloc = 395, + pkey_free = 396, + statx = 397, + rseq = 398, + io_pgetevents = 399, + migrate_pages = 400, + kexec_file_load = 401, + clock_gettime64 = 403, + clock_settime64 = 404, + clock_adjtime64 = 405, + clock_getres_time64 = 406, + clock_nanosleep_time64 = 407, + timer_gettime64 = 408, + timer_settime64 = 409, + timerfd_gettime64 = 410, + timerfd_settime64 = 411, + utimensat_time64 = 412, + pselect6_time64 = 413, + ppoll_time64 = 414, + io_pgetevents_time64 = 416, + recvmmsg_time64 = 417, + mq_timedsend_time64 = 418, + mq_timedreceive_time64 = 419, + semtimedop_time64 = 420, + rt_sigtimedwait_time64 = 421, + futex_time64 = 422, + sched_rr_get_interval_time64 = 423, + pidfd_send_signal = 424, + io_uring_setup = 425, + io_uring_enter = 426, + io_uring_register = 427, + open_tree = 428, + move_mount = 429, + fsopen = 430, + fsconfig = 431, + fsmount = 432, + fspick = 433, + pidfd_open = 434, + clone3 = 435, + openat2 = 437, + pidfd_getfd = 438, -pub const SYS_breakpoint = 0x0f0001; -pub const SYS_cacheflush = 0x0f0002; -pub const SYS_usr26 = 0x0f0003; -pub const SYS_usr32 = 0x0f0004; -pub const SYS_set_tls = 0x0f0005; -pub const SYS_get_tls = 0x0f0006; + breakpoint = 0x0f0001, + cacheflush = 0x0f0002, + usr26 = 0x0f0003, + usr32 = 0x0f0004, + set_tls = 0x0f0005, + get_tls = 0x0f0006, + + _, +}; pub const MMAP2_UNIT = 4096; diff --git a/lib/std/os/bits/linux/arm64.zig b/lib/std/os/bits/linux/arm64.zig index 79a363f844..7e745a51d8 100644 --- a/lib/std/os/bits/linux/arm64.zig +++ b/lib/std/os/bits/linux/arm64.zig @@ -10,300 +10,303 @@ const uid_t = linux.uid_t; const gid_t = linux.gid_t; const stack_t = linux.stack_t; const sigset_t = linux.sigset_t; +pub const SYS = extern enum(usize) { + io_setup = 0, + io_destroy = 1, + io_submit = 2, + io_cancel = 3, + io_getevents = 4, + setxattr = 5, + lsetxattr = 6, + fsetxattr = 7, + getxattr = 8, + lgetxattr = 9, + fgetxattr = 10, + listxattr = 11, + llistxattr = 12, + flistxattr = 13, + removexattr = 14, + lremovexattr = 15, + fremovexattr = 16, + getcwd = 17, + lookup_dcookie = 18, + eventfd2 = 19, + epoll_create1 = 20, + epoll_ctl = 21, + epoll_pwait = 22, + dup = 23, + dup3 = 24, + fcntl = 25, + inotify_init1 = 26, + inotify_add_watch = 27, + inotify_rm_watch = 28, + ioctl = 29, + ioprio_set = 30, + ioprio_get = 31, + flock = 32, + mknodat = 33, + mkdirat = 34, + unlinkat = 35, + symlinkat = 36, + linkat = 37, + renameat = 38, + umount2 = 39, + mount = 40, + pivot_root = 41, + nfsservctl = 42, + statfs = 43, + fstatfs = 44, + truncate = 45, + ftruncate = 46, + fallocate = 47, + faccessat = 48, + chdir = 49, + fchdir = 50, + chroot = 51, + fchmod = 52, + fchmodat = 53, + fchownat = 54, + fchown = 55, + openat = 56, + close = 57, + vhangup = 58, + pipe2 = 59, + quotactl = 60, + getdents64 = 61, + lseek = 62, + read = 63, + write = 64, + readv = 65, + writev = 66, + pread64 = 67, + pwrite64 = 68, + preadv = 69, + pwritev = 70, + sendfile = 71, + pselect6 = 72, + ppoll = 73, + signalfd4 = 74, + vmsplice = 75, + splice = 76, + tee = 77, + readlinkat = 78, + fstatat = 79, + fstat = 80, + sync = 81, + fsync = 82, + fdatasync = 83, + sync_file_range2 = 84, + sync_file_range = 84, + timerfd_create = 85, + timerfd_settime = 86, + timerfd_gettime = 87, + utimensat = 88, + acct = 89, + capget = 90, + capset = 91, + personality = 92, + exit = 93, + exit_group = 94, + waitid = 95, + set_tid_address = 96, + unshare = 97, + futex = 98, + set_robust_list = 99, + get_robust_list = 100, + nanosleep = 101, + getitimer = 102, + setitimer = 103, + kexec_load = 104, + init_module = 105, + delete_module = 106, + timer_create = 107, + timer_gettime = 108, + timer_getoverrun = 109, + timer_settime = 110, + timer_delete = 111, + clock_settime = 112, + clock_gettime = 113, + clock_getres = 114, + clock_nanosleep = 115, + syslog = 116, + ptrace = 117, + sched_setparam = 118, + sched_setscheduler = 119, + sched_getscheduler = 120, + sched_getparam = 121, + sched_setaffinity = 122, + sched_getaffinity = 123, + sched_yield = 124, + sched_get_priority_max = 125, + sched_get_priority_min = 126, + sched_rr_get_interval = 127, + restart_syscall = 128, + kill = 129, + tkill = 130, + tgkill = 131, + sigaltstack = 132, + rt_sigsuspend = 133, + rt_sigaction = 134, + rt_sigprocmask = 135, + rt_sigpending = 136, + rt_sigtimedwait = 137, + rt_sigqueueinfo = 138, + rt_sigreturn = 139, + setpriority = 140, + getpriority = 141, + reboot = 142, + setregid = 143, + setgid = 144, + setreuid = 145, + setuid = 146, + setresuid = 147, + getresuid = 148, + setresgid = 149, + getresgid = 150, + setfsuid = 151, + setfsgid = 152, + times = 153, + setpgid = 154, + getpgid = 155, + getsid = 156, + setsid = 157, + getgroups = 158, + setgroups = 159, + uname = 160, + sethostname = 161, + setdomainname = 162, + getrlimit = 163, + setrlimit = 164, + getrusage = 165, + umask = 166, + prctl = 167, + getcpu = 168, + gettimeofday = 169, + settimeofday = 170, + adjtimex = 171, + getpid = 172, + getppid = 173, + getuid = 174, + geteuid = 175, + getgid = 176, + getegid = 177, + gettid = 178, + sysinfo = 179, + mq_open = 180, + mq_unlink = 181, + mq_timedsend = 182, + mq_timedreceive = 183, + mq_notify = 184, + mq_getsetattr = 185, + msgget = 186, + msgctl = 187, + msgrcv = 188, + msgsnd = 189, + semget = 190, + semctl = 191, + semtimedop = 192, + semop = 193, + shmget = 194, + shmctl = 195, + shmat = 196, + shmdt = 197, + socket = 198, + socketpair = 199, + bind = 200, + listen = 201, + accept = 202, + connect = 203, + getsockname = 204, + getpeername = 205, + sendto = 206, + recvfrom = 207, + setsockopt = 208, + getsockopt = 209, + shutdown = 210, + sendmsg = 211, + recvmsg = 212, + readahead = 213, + brk = 214, + munmap = 215, + mremap = 216, + add_key = 217, + request_key = 218, + keyctl = 219, + clone = 220, + execve = 221, + mmap = 222, + fadvise64 = 223, + swapon = 224, + swapoff = 225, + mprotect = 226, + msync = 227, + mlock = 228, + munlock = 229, + mlockall = 230, + munlockall = 231, + mincore = 232, + madvise = 233, + remap_file_pages = 234, + mbind = 235, + get_mempolicy = 236, + set_mempolicy = 237, + migrate_pages = 238, + move_pages = 239, + rt_tgsigqueueinfo = 240, + perf_event_open = 241, + accept4 = 242, + recvmmsg = 243, + arch_specific_syscall = 244, + wait4 = 260, + prlimit64 = 261, + fanotify_init = 262, + fanotify_mark = 263, + clock_adjtime = 266, + syncfs = 267, + setns = 268, + sendmmsg = 269, + process_vm_readv = 270, + process_vm_writev = 271, + kcmp = 272, + finit_module = 273, + sched_setattr = 274, + sched_getattr = 275, + renameat2 = 276, + seccomp = 277, + getrandom = 278, + memfd_create = 279, + bpf = 280, + execveat = 281, + userfaultfd = 282, + membarrier = 283, + mlock2 = 284, + copy_file_range = 285, + preadv2 = 286, + pwritev2 = 287, + pkey_mprotect = 288, + pkey_alloc = 289, + pkey_free = 290, + statx = 291, + io_pgetevents = 292, + rseq = 293, + kexec_file_load = 294, + pidfd_send_signal = 424, + io_uring_setup = 425, + io_uring_enter = 426, + io_uring_register = 427, + open_tree = 428, + move_mount = 429, + fsopen = 430, + fsconfig = 431, + fsmount = 432, + fspick = 433, + pidfd_open = 434, + clone3 = 435, + openat2 = 437, + pidfd_getfd = 438, -pub const SYS_io_setup = 0; -pub const SYS_io_destroy = 1; -pub const SYS_io_submit = 2; -pub const SYS_io_cancel = 3; -pub const SYS_io_getevents = 4; -pub const SYS_setxattr = 5; -pub const SYS_lsetxattr = 6; -pub const SYS_fsetxattr = 7; -pub const SYS_getxattr = 8; -pub const SYS_lgetxattr = 9; -pub const SYS_fgetxattr = 10; -pub const SYS_listxattr = 11; -pub const SYS_llistxattr = 12; -pub const SYS_flistxattr = 13; -pub const SYS_removexattr = 14; -pub const SYS_lremovexattr = 15; -pub const SYS_fremovexattr = 16; -pub const SYS_getcwd = 17; -pub const SYS_lookup_dcookie = 18; -pub const SYS_eventfd2 = 19; -pub const SYS_epoll_create1 = 20; -pub const SYS_epoll_ctl = 21; -pub const SYS_epoll_pwait = 22; -pub const SYS_dup = 23; -pub const SYS_dup3 = 24; -pub const SYS_fcntl = 25; -pub const SYS_inotify_init1 = 26; -pub const SYS_inotify_add_watch = 27; -pub const SYS_inotify_rm_watch = 28; -pub const SYS_ioctl = 29; -pub const SYS_ioprio_set = 30; -pub const SYS_ioprio_get = 31; -pub const SYS_flock = 32; -pub const SYS_mknodat = 33; -pub const SYS_mkdirat = 34; -pub const SYS_unlinkat = 35; -pub const SYS_symlinkat = 36; -pub const SYS_linkat = 37; -pub const SYS_renameat = 38; -pub const SYS_umount2 = 39; -pub const SYS_mount = 40; -pub const SYS_pivot_root = 41; -pub const SYS_nfsservctl = 42; -pub const SYS_statfs = 43; -pub const SYS_fstatfs = 44; -pub const SYS_truncate = 45; -pub const SYS_ftruncate = 46; -pub const SYS_fallocate = 47; -pub const SYS_faccessat = 48; -pub const SYS_chdir = 49; -pub const SYS_fchdir = 50; -pub const SYS_chroot = 51; -pub const SYS_fchmod = 52; -pub const SYS_fchmodat = 53; -pub const SYS_fchownat = 54; -pub const SYS_fchown = 55; -pub const SYS_openat = 56; -pub const SYS_close = 57; -pub const SYS_vhangup = 58; -pub const SYS_pipe2 = 59; -pub const SYS_quotactl = 60; -pub const SYS_getdents64 = 61; -pub const SYS_lseek = 62; -pub const SYS_read = 63; -pub const SYS_write = 64; -pub const SYS_readv = 65; -pub const SYS_writev = 66; -pub const SYS_pread64 = 67; -pub const SYS_pwrite64 = 68; -pub const SYS_preadv = 69; -pub const SYS_pwritev = 70; -pub const SYS_sendfile = 71; -pub const SYS_pselect6 = 72; -pub const SYS_ppoll = 73; -pub const SYS_signalfd4 = 74; -pub const SYS_vmsplice = 75; -pub const SYS_splice = 76; -pub const SYS_tee = 77; -pub const SYS_readlinkat = 78; -pub const SYS_fstatat = 79; -pub const SYS_fstat = 80; -pub const SYS_sync = 81; -pub const SYS_fsync = 82; -pub const SYS_fdatasync = 83; -pub const SYS_sync_file_range2 = 84; -pub const SYS_sync_file_range = 84; -pub const SYS_timerfd_create = 85; -pub const SYS_timerfd_settime = 86; -pub const SYS_timerfd_gettime = 87; -pub const SYS_utimensat = 88; -pub const SYS_acct = 89; -pub const SYS_capget = 90; -pub const SYS_capset = 91; -pub const SYS_personality = 92; -pub const SYS_exit = 93; -pub const SYS_exit_group = 94; -pub const SYS_waitid = 95; -pub const SYS_set_tid_address = 96; -pub const SYS_unshare = 97; -pub const SYS_futex = 98; -pub const SYS_set_robust_list = 99; -pub const SYS_get_robust_list = 100; -pub const SYS_nanosleep = 101; -pub const SYS_getitimer = 102; -pub const SYS_setitimer = 103; -pub const SYS_kexec_load = 104; -pub const SYS_init_module = 105; -pub const SYS_delete_module = 106; -pub const SYS_timer_create = 107; -pub const SYS_timer_gettime = 108; -pub const SYS_timer_getoverrun = 109; -pub const SYS_timer_settime = 110; -pub const SYS_timer_delete = 111; -pub const SYS_clock_settime = 112; -pub const SYS_clock_gettime = 113; -pub const SYS_clock_getres = 114; -pub const SYS_clock_nanosleep = 115; -pub const SYS_syslog = 116; -pub const SYS_ptrace = 117; -pub const SYS_sched_setparam = 118; -pub const SYS_sched_setscheduler = 119; -pub const SYS_sched_getscheduler = 120; -pub const SYS_sched_getparam = 121; -pub const SYS_sched_setaffinity = 122; -pub const SYS_sched_getaffinity = 123; -pub const SYS_sched_yield = 124; -pub const SYS_sched_get_priority_max = 125; -pub const SYS_sched_get_priority_min = 126; -pub const SYS_sched_rr_get_interval = 127; -pub const SYS_restart_syscall = 128; -pub const SYS_kill = 129; -pub const SYS_tkill = 130; -pub const SYS_tgkill = 131; -pub const SYS_sigaltstack = 132; -pub const SYS_rt_sigsuspend = 133; -pub const SYS_rt_sigaction = 134; -pub const SYS_rt_sigprocmask = 135; -pub const SYS_rt_sigpending = 136; -pub const SYS_rt_sigtimedwait = 137; -pub const SYS_rt_sigqueueinfo = 138; -pub const SYS_rt_sigreturn = 139; -pub const SYS_setpriority = 140; -pub const SYS_getpriority = 141; -pub const SYS_reboot = 142; -pub const SYS_setregid = 143; -pub const SYS_setgid = 144; -pub const SYS_setreuid = 145; -pub const SYS_setuid = 146; -pub const SYS_setresuid = 147; -pub const SYS_getresuid = 148; -pub const SYS_setresgid = 149; -pub const SYS_getresgid = 150; -pub const SYS_setfsuid = 151; -pub const SYS_setfsgid = 152; -pub const SYS_times = 153; -pub const SYS_setpgid = 154; -pub const SYS_getpgid = 155; -pub const SYS_getsid = 156; -pub const SYS_setsid = 157; -pub const SYS_getgroups = 158; -pub const SYS_setgroups = 159; -pub const SYS_uname = 160; -pub const SYS_sethostname = 161; -pub const SYS_setdomainname = 162; -pub const SYS_getrlimit = 163; -pub const SYS_setrlimit = 164; -pub const SYS_getrusage = 165; -pub const SYS_umask = 166; -pub const SYS_prctl = 167; -pub const SYS_getcpu = 168; -pub const SYS_gettimeofday = 169; -pub const SYS_settimeofday = 170; -pub const SYS_adjtimex = 171; -pub const SYS_getpid = 172; -pub const SYS_getppid = 173; -pub const SYS_getuid = 174; -pub const SYS_geteuid = 175; -pub const SYS_getgid = 176; -pub const SYS_getegid = 177; -pub const SYS_gettid = 178; -pub const SYS_sysinfo = 179; -pub const SYS_mq_open = 180; -pub const SYS_mq_unlink = 181; -pub const SYS_mq_timedsend = 182; -pub const SYS_mq_timedreceive = 183; -pub const SYS_mq_notify = 184; -pub const SYS_mq_getsetattr = 185; -pub const SYS_msgget = 186; -pub const SYS_msgctl = 187; -pub const SYS_msgrcv = 188; -pub const SYS_msgsnd = 189; -pub const SYS_semget = 190; -pub const SYS_semctl = 191; -pub const SYS_semtimedop = 192; -pub const SYS_semop = 193; -pub const SYS_shmget = 194; -pub const SYS_shmctl = 195; -pub const SYS_shmat = 196; -pub const SYS_shmdt = 197; -pub const SYS_socket = 198; -pub const SYS_socketpair = 199; -pub const SYS_bind = 200; -pub const SYS_listen = 201; -pub const SYS_accept = 202; -pub const SYS_connect = 203; -pub const SYS_getsockname = 204; -pub const SYS_getpeername = 205; -pub const SYS_sendto = 206; -pub const SYS_recvfrom = 207; -pub const SYS_setsockopt = 208; -pub const SYS_getsockopt = 209; -pub const SYS_shutdown = 210; -pub const SYS_sendmsg = 211; -pub const SYS_recvmsg = 212; -pub const SYS_readahead = 213; -pub const SYS_brk = 214; -pub const SYS_munmap = 215; -pub const SYS_mremap = 216; -pub const SYS_add_key = 217; -pub const SYS_request_key = 218; -pub const SYS_keyctl = 219; -pub const SYS_clone = 220; -pub const SYS_execve = 221; -pub const SYS_mmap = 222; -pub const SYS_fadvise64 = 223; -pub const SYS_swapon = 224; -pub const SYS_swapoff = 225; -pub const SYS_mprotect = 226; -pub const SYS_msync = 227; -pub const SYS_mlock = 228; -pub const SYS_munlock = 229; -pub const SYS_mlockall = 230; -pub const SYS_munlockall = 231; -pub const SYS_mincore = 232; -pub const SYS_madvise = 233; -pub const SYS_remap_file_pages = 234; -pub const SYS_mbind = 235; -pub const SYS_get_mempolicy = 236; -pub const SYS_set_mempolicy = 237; -pub const SYS_migrate_pages = 238; -pub const SYS_move_pages = 239; -pub const SYS_rt_tgsigqueueinfo = 240; -pub const SYS_perf_event_open = 241; -pub const SYS_accept4 = 242; -pub const SYS_recvmmsg = 243; -pub const SYS_arch_specific_syscall = 244; -pub const SYS_wait4 = 260; -pub const SYS_prlimit64 = 261; -pub const SYS_fanotify_init = 262; -pub const SYS_fanotify_mark = 263; -pub const SYS_clock_adjtime = 266; -pub const SYS_syncfs = 267; -pub const SYS_setns = 268; -pub const SYS_sendmmsg = 269; -pub const SYS_process_vm_readv = 270; -pub const SYS_process_vm_writev = 271; -pub const SYS_kcmp = 272; -pub const SYS_finit_module = 273; -pub const SYS_sched_setattr = 274; -pub const SYS_sched_getattr = 275; -pub const SYS_renameat2 = 276; -pub const SYS_seccomp = 277; -pub const SYS_getrandom = 278; -pub const SYS_memfd_create = 279; -pub const SYS_bpf = 280; -pub const SYS_execveat = 281; -pub const SYS_userfaultfd = 282; -pub const SYS_membarrier = 283; -pub const SYS_mlock2 = 284; -pub const SYS_copy_file_range = 285; -pub const SYS_preadv2 = 286; -pub const SYS_pwritev2 = 287; -pub const SYS_pkey_mprotect = 288; -pub const SYS_pkey_alloc = 289; -pub const SYS_pkey_free = 290; -pub const SYS_statx = 291; -pub const SYS_io_pgetevents = 292; -pub const SYS_rseq = 293; -pub const SYS_kexec_file_load = 294; -pub const SYS_pidfd_send_signal = 424; -pub const SYS_io_uring_setup = 425; -pub const SYS_io_uring_enter = 426; -pub const SYS_io_uring_register = 427; -pub const SYS_open_tree = 428; -pub const SYS_move_mount = 429; -pub const SYS_fsopen = 430; -pub const SYS_fsconfig = 431; -pub const SYS_fsmount = 432; -pub const SYS_fspick = 433; -pub const SYS_pidfd_open = 434; -pub const SYS_clone3 = 435; -pub const SYS_openat2 = 437; -pub const SYS_pidfd_getfd = 438; + _, +}; pub const O_CREAT = 0o100; pub const O_EXCL = 0o200; diff --git a/lib/std/os/bits/linux/i386.zig b/lib/std/os/bits/linux/i386.zig index 233340f6a1..f6dfef29bd 100644 --- a/lib/std/os/bits/linux/i386.zig +++ b/lib/std/os/bits/linux/i386.zig @@ -11,431 +11,435 @@ const gid_t = linux.gid_t; const stack_t = linux.stack_t; const sigset_t = linux.sigset_t; -pub const SYS_restart_syscall = 0; -pub const SYS_exit = 1; -pub const SYS_fork = 2; -pub const SYS_read = 3; -pub const SYS_write = 4; -pub const SYS_open = 5; -pub const SYS_close = 6; -pub const SYS_waitpid = 7; -pub const SYS_creat = 8; -pub const SYS_link = 9; -pub const SYS_unlink = 10; -pub const SYS_execve = 11; -pub const SYS_chdir = 12; -pub const SYS_time = 13; -pub const SYS_mknod = 14; -pub const SYS_chmod = 15; -pub const SYS_lchown = 16; -pub const SYS_break = 17; -pub const SYS_oldstat = 18; -pub const SYS_lseek = 19; -pub const SYS_getpid = 20; -pub const SYS_mount = 21; -pub const SYS_umount = 22; -pub const SYS_setuid = 23; -pub const SYS_getuid = 24; -pub const SYS_stime = 25; -pub const SYS_ptrace = 26; -pub const SYS_alarm = 27; -pub const SYS_oldfstat = 28; -pub const SYS_pause = 29; -pub const SYS_utime = 30; -pub const SYS_stty = 31; -pub const SYS_gtty = 32; -pub const SYS_access = 33; -pub const SYS_nice = 34; -pub const SYS_ftime = 35; -pub const SYS_sync = 36; -pub const SYS_kill = 37; -pub const SYS_rename = 38; -pub const SYS_mkdir = 39; -pub const SYS_rmdir = 40; -pub const SYS_dup = 41; -pub const SYS_pipe = 42; -pub const SYS_times = 43; -pub const SYS_prof = 44; -pub const SYS_brk = 45; -pub const SYS_setgid = 46; -pub const SYS_getgid = 47; -pub const SYS_signal = 48; -pub const SYS_geteuid = 49; -pub const SYS_getegid = 50; -pub const SYS_acct = 51; -pub const SYS_umount2 = 52; -pub const SYS_lock = 53; -pub const SYS_ioctl = 54; -pub const SYS_fcntl = 55; -pub const SYS_mpx = 56; -pub const SYS_setpgid = 57; -pub const SYS_ulimit = 58; -pub const SYS_oldolduname = 59; -pub const SYS_umask = 60; -pub const SYS_chroot = 61; -pub const SYS_ustat = 62; -pub const SYS_dup2 = 63; -pub const SYS_getppid = 64; -pub const SYS_getpgrp = 65; -pub const SYS_setsid = 66; -pub const SYS_sigaction = 67; -pub const SYS_sgetmask = 68; -pub const SYS_ssetmask = 69; -pub const SYS_setreuid = 70; -pub const SYS_setregid = 71; -pub const SYS_sigsuspend = 72; -pub const SYS_sigpending = 73; -pub const SYS_sethostname = 74; -pub const SYS_setrlimit = 75; -pub const SYS_getrlimit = 76; -pub const SYS_getrusage = 77; -pub const SYS_gettimeofday = 78; -pub const SYS_settimeofday = 79; -pub const SYS_getgroups = 80; -pub const SYS_setgroups = 81; -pub const SYS_select = 82; -pub const SYS_symlink = 83; -pub const SYS_oldlstat = 84; -pub const SYS_readlink = 85; -pub const SYS_uselib = 86; -pub const SYS_swapon = 87; -pub const SYS_reboot = 88; -pub const SYS_readdir = 89; -pub const SYS_mmap = 90; -pub const SYS_munmap = 91; -pub const SYS_truncate = 92; -pub const SYS_ftruncate = 93; -pub const SYS_fchmod = 94; -pub const SYS_fchown = 95; -pub const SYS_getpriority = 96; -pub const SYS_setpriority = 97; -pub const SYS_profil = 98; -pub const SYS_statfs = 99; -pub const SYS_fstatfs = 100; -pub const SYS_ioperm = 101; -pub const SYS_socketcall = 102; -pub const SYS_syslog = 103; -pub const SYS_setitimer = 104; -pub const SYS_getitimer = 105; -pub const SYS_stat = 106; -pub const SYS_lstat = 107; -pub const SYS_fstat = 108; -pub const SYS_olduname = 109; -pub const SYS_iopl = 110; -pub const SYS_vhangup = 111; -pub const SYS_idle = 112; -pub const SYS_vm86old = 113; -pub const SYS_wait4 = 114; -pub const SYS_swapoff = 115; -pub const SYS_sysinfo = 116; -pub const SYS_ipc = 117; -pub const SYS_fsync = 118; -pub const SYS_sigreturn = 119; -pub const SYS_clone = 120; -pub const SYS_setdomainname = 121; -pub const SYS_uname = 122; -pub const SYS_modify_ldt = 123; -pub const SYS_adjtimex = 124; -pub const SYS_mprotect = 125; -pub const SYS_sigprocmask = 126; -pub const SYS_create_module = 127; -pub const SYS_init_module = 128; -pub const SYS_delete_module = 129; -pub const SYS_get_kernel_syms = 130; -pub const SYS_quotactl = 131; -pub const SYS_getpgid = 132; -pub const SYS_fchdir = 133; -pub const SYS_bdflush = 134; -pub const SYS_sysfs = 135; -pub const SYS_personality = 136; -pub const SYS_afs_syscall = 137; -pub const SYS_setfsuid = 138; -pub const SYS_setfsgid = 139; -pub const SYS__llseek = 140; -pub const SYS_getdents = 141; -pub const SYS__newselect = 142; -pub const SYS_flock = 143; -pub const SYS_msync = 144; -pub const SYS_readv = 145; -pub const SYS_writev = 146; -pub const SYS_getsid = 147; -pub const SYS_fdatasync = 148; -pub const SYS__sysctl = 149; -pub const SYS_mlock = 150; -pub const SYS_munlock = 151; -pub const SYS_mlockall = 152; -pub const SYS_munlockall = 153; -pub const SYS_sched_setparam = 154; -pub const SYS_sched_getparam = 155; -pub const SYS_sched_setscheduler = 156; -pub const SYS_sched_getscheduler = 157; -pub const SYS_sched_yield = 158; -pub const SYS_sched_get_priority_max = 159; -pub const SYS_sched_get_priority_min = 160; -pub const SYS_sched_rr_get_interval = 161; -pub const SYS_nanosleep = 162; -pub const SYS_mremap = 163; -pub const SYS_setresuid = 164; -pub const SYS_getresuid = 165; -pub const SYS_vm86 = 166; -pub const SYS_query_module = 167; -pub const SYS_poll = 168; -pub const SYS_nfsservctl = 169; -pub const SYS_setresgid = 170; -pub const SYS_getresgid = 171; -pub const SYS_prctl = 172; -pub const SYS_rt_sigreturn = 173; -pub const SYS_rt_sigaction = 174; -pub const SYS_rt_sigprocmask = 175; -pub const SYS_rt_sigpending = 176; -pub const SYS_rt_sigtimedwait = 177; -pub const SYS_rt_sigqueueinfo = 178; -pub const SYS_rt_sigsuspend = 179; -pub const SYS_pread64 = 180; -pub const SYS_pwrite64 = 181; -pub const SYS_chown = 182; -pub const SYS_getcwd = 183; -pub const SYS_capget = 184; -pub const SYS_capset = 185; -pub const SYS_sigaltstack = 186; -pub const SYS_sendfile = 187; -pub const SYS_getpmsg = 188; -pub const SYS_putpmsg = 189; -pub const SYS_vfork = 190; -pub const SYS_ugetrlimit = 191; -pub const SYS_mmap2 = 192; -pub const SYS_truncate64 = 193; -pub const SYS_ftruncate64 = 194; -pub const SYS_stat64 = 195; -pub const SYS_lstat64 = 196; -pub const SYS_fstat64 = 197; -pub const SYS_lchown32 = 198; -pub const SYS_getuid32 = 199; -pub const SYS_getgid32 = 200; -pub const SYS_geteuid32 = 201; -pub const SYS_getegid32 = 202; -pub const SYS_setreuid32 = 203; -pub const SYS_setregid32 = 204; -pub const SYS_getgroups32 = 205; -pub const SYS_setgroups32 = 206; -pub const SYS_fchown32 = 207; -pub const SYS_setresuid32 = 208; -pub const SYS_getresuid32 = 209; -pub const SYS_setresgid32 = 210; -pub const SYS_getresgid32 = 211; -pub const SYS_chown32 = 212; -pub const SYS_setuid32 = 213; -pub const SYS_setgid32 = 214; -pub const SYS_setfsuid32 = 215; -pub const SYS_setfsgid32 = 216; -pub const SYS_pivot_root = 217; -pub const SYS_mincore = 218; -pub const SYS_madvise = 219; -pub const SYS_getdents64 = 220; -pub const SYS_fcntl64 = 221; -pub const SYS_gettid = 224; -pub const SYS_readahead = 225; -pub const SYS_setxattr = 226; -pub const SYS_lsetxattr = 227; -pub const SYS_fsetxattr = 228; -pub const SYS_getxattr = 229; -pub const SYS_lgetxattr = 230; -pub const SYS_fgetxattr = 231; -pub const SYS_listxattr = 232; -pub const SYS_llistxattr = 233; -pub const SYS_flistxattr = 234; -pub const SYS_removexattr = 235; -pub const SYS_lremovexattr = 236; -pub const SYS_fremovexattr = 237; -pub const SYS_tkill = 238; -pub const SYS_sendfile64 = 239; -pub const SYS_futex = 240; -pub const SYS_sched_setaffinity = 241; -pub const SYS_sched_getaffinity = 242; -pub const SYS_set_thread_area = 243; -pub const SYS_get_thread_area = 244; -pub const SYS_io_setup = 245; -pub const SYS_io_destroy = 246; -pub const SYS_io_getevents = 247; -pub const SYS_io_submit = 248; -pub const SYS_io_cancel = 249; -pub const SYS_fadvise64 = 250; -pub const SYS_exit_group = 252; -pub const SYS_lookup_dcookie = 253; -pub const SYS_epoll_create = 254; -pub const SYS_epoll_ctl = 255; -pub const SYS_epoll_wait = 256; -pub const SYS_remap_file_pages = 257; -pub const SYS_set_tid_address = 258; -pub const SYS_timer_create = 259; -pub const SYS_timer_settime = SYS_timer_create + 1; -pub const SYS_timer_gettime = SYS_timer_create + 2; -pub const SYS_timer_getoverrun = SYS_timer_create + 3; -pub const SYS_timer_delete = SYS_timer_create + 4; -pub const SYS_clock_settime = SYS_timer_create + 5; -pub const SYS_clock_gettime = SYS_timer_create + 6; -pub const SYS_clock_getres = SYS_timer_create + 7; -pub const SYS_clock_nanosleep = SYS_timer_create + 8; -pub const SYS_statfs64 = 268; -pub const SYS_fstatfs64 = 269; -pub const SYS_tgkill = 270; -pub const SYS_utimes = 271; -pub const SYS_fadvise64_64 = 272; -pub const SYS_vserver = 273; -pub const SYS_mbind = 274; -pub const SYS_get_mempolicy = 275; -pub const SYS_set_mempolicy = 276; -pub const SYS_mq_open = 277; -pub const SYS_mq_unlink = SYS_mq_open + 1; -pub const SYS_mq_timedsend = SYS_mq_open + 2; -pub const SYS_mq_timedreceive = SYS_mq_open + 3; -pub const SYS_mq_notify = SYS_mq_open + 4; -pub const SYS_mq_getsetattr = SYS_mq_open + 5; -pub const SYS_kexec_load = 283; -pub const SYS_waitid = 284; -pub const SYS_add_key = 286; -pub const SYS_request_key = 287; -pub const SYS_keyctl = 288; -pub const SYS_ioprio_set = 289; -pub const SYS_ioprio_get = 290; -pub const SYS_inotify_init = 291; -pub const SYS_inotify_add_watch = 292; -pub const SYS_inotify_rm_watch = 293; -pub const SYS_migrate_pages = 294; -pub const SYS_openat = 295; -pub const SYS_mkdirat = 296; -pub const SYS_mknodat = 297; -pub const SYS_fchownat = 298; -pub const SYS_futimesat = 299; -pub const SYS_fstatat64 = 300; -pub const SYS_unlinkat = 301; -pub const SYS_renameat = 302; -pub const SYS_linkat = 303; -pub const SYS_symlinkat = 304; -pub const SYS_readlinkat = 305; -pub const SYS_fchmodat = 306; -pub const SYS_faccessat = 307; -pub const SYS_pselect6 = 308; -pub const SYS_ppoll = 309; -pub const SYS_unshare = 310; -pub const SYS_set_robust_list = 311; -pub const SYS_get_robust_list = 312; -pub const SYS_splice = 313; -pub const SYS_sync_file_range = 314; -pub const SYS_tee = 315; -pub const SYS_vmsplice = 316; -pub const SYS_move_pages = 317; -pub const SYS_getcpu = 318; -pub const SYS_epoll_pwait = 319; -pub const SYS_utimensat = 320; -pub const SYS_signalfd = 321; -pub const SYS_timerfd_create = 322; -pub const SYS_eventfd = 323; -pub const SYS_fallocate = 324; -pub const SYS_timerfd_settime = 325; -pub const SYS_timerfd_gettime = 326; -pub const SYS_signalfd4 = 327; -pub const SYS_eventfd2 = 328; -pub const SYS_epoll_create1 = 329; -pub const SYS_dup3 = 330; -pub const SYS_pipe2 = 331; -pub const SYS_inotify_init1 = 332; -pub const SYS_preadv = 333; -pub const SYS_pwritev = 334; -pub const SYS_rt_tgsigqueueinfo = 335; -pub const SYS_perf_event_open = 336; -pub const SYS_recvmmsg = 337; -pub const SYS_fanotify_init = 338; -pub const SYS_fanotify_mark = 339; -pub const SYS_prlimit64 = 340; -pub const SYS_name_to_handle_at = 341; -pub const SYS_open_by_handle_at = 342; -pub const SYS_clock_adjtime = 343; -pub const SYS_syncfs = 344; -pub const SYS_sendmmsg = 345; -pub const SYS_setns = 346; -pub const SYS_process_vm_readv = 347; -pub const SYS_process_vm_writev = 348; -pub const SYS_kcmp = 349; -pub const SYS_finit_module = 350; -pub const SYS_sched_setattr = 351; -pub const SYS_sched_getattr = 352; -pub const SYS_renameat2 = 353; -pub const SYS_seccomp = 354; -pub const SYS_getrandom = 355; -pub const SYS_memfd_create = 356; -pub const SYS_bpf = 357; -pub const SYS_execveat = 358; -pub const SYS_socket = 359; -pub const SYS_socketpair = 360; -pub const SYS_bind = 361; -pub const SYS_connect = 362; -pub const SYS_listen = 363; -pub const SYS_accept4 = 364; -pub const SYS_getsockopt = 365; -pub const SYS_setsockopt = 366; -pub const SYS_getsockname = 367; -pub const SYS_getpeername = 368; -pub const SYS_sendto = 369; -pub const SYS_sendmsg = 370; -pub const SYS_recvfrom = 371; -pub const SYS_recvmsg = 372; -pub const SYS_shutdown = 373; -pub const SYS_userfaultfd = 374; -pub const SYS_membarrier = 375; -pub const SYS_mlock2 = 376; -pub const SYS_copy_file_range = 377; -pub const SYS_preadv2 = 378; -pub const SYS_pwritev2 = 379; -pub const SYS_pkey_mprotect = 380; -pub const SYS_pkey_alloc = 381; -pub const SYS_pkey_free = 382; -pub const SYS_statx = 383; -pub const SYS_arch_prctl = 384; -pub const SYS_io_pgetevents = 385; -pub const SYS_rseq = 386; -pub const SYS_semget = 393; -pub const SYS_semctl = 394; -pub const SYS_shmget = 395; -pub const SYS_shmctl = 396; -pub const SYS_shmat = 397; -pub const SYS_shmdt = 398; -pub const SYS_msgget = 399; -pub const SYS_msgsnd = 400; -pub const SYS_msgrcv = 401; -pub const SYS_msgctl = 402; -pub const SYS_clock_gettime64 = 403; -pub const SYS_clock_settime64 = 404; -pub const SYS_clock_adjtime64 = 405; -pub const SYS_clock_getres_time64 = 406; -pub const SYS_clock_nanosleep_time64 = 407; -pub const SYS_timer_gettime64 = 408; -pub const SYS_timer_settime64 = 409; -pub const SYS_timerfd_gettime64 = 410; -pub const SYS_timerfd_settime64 = 411; -pub const SYS_utimensat_time64 = 412; -pub const SYS_pselect6_time64 = 413; -pub const SYS_ppoll_time64 = 414; -pub const SYS_io_pgetevents_time64 = 416; -pub const SYS_recvmmsg_time64 = 417; -pub const SYS_mq_timedsend_time64 = 418; -pub const SYS_mq_timedreceive_time64 = 419; -pub const SYS_semtimedop_time64 = 420; -pub const SYS_rt_sigtimedwait_time64 = 421; -pub const SYS_futex_time64 = 422; -pub const SYS_sched_rr_get_interval_time64 = 423; -pub const SYS_pidfd_send_signal = 424; -pub const SYS_io_uring_setup = 425; -pub const SYS_io_uring_enter = 426; -pub const SYS_io_uring_register = 427; -pub const SYS_open_tree = 428; -pub const SYS_move_mount = 429; -pub const SYS_fsopen = 430; -pub const SYS_fsconfig = 431; -pub const SYS_fsmount = 432; -pub const SYS_fspick = 433; -pub const SYS_openat2 = 437; -pub const SYS_pidfd_getfd = 438; +pub const SYS = extern enum(usize) { + restart_syscall = 0, + exit = 1, + fork = 2, + read = 3, + write = 4, + open = 5, + close = 6, + waitpid = 7, + creat = 8, + link = 9, + unlink = 10, + execve = 11, + chdir = 12, + time = 13, + mknod = 14, + chmod = 15, + lchown = 16, + @"break" = 17, + oldstat = 18, + lseek = 19, + getpid = 20, + mount = 21, + umount = 22, + setuid = 23, + getuid = 24, + stime = 25, + ptrace = 26, + alarm = 27, + oldfstat = 28, + pause = 29, + utime = 30, + stty = 31, + gtty = 32, + access = 33, + nice = 34, + ftime = 35, + sync = 36, + kill = 37, + rename = 38, + mkdir = 39, + rmdir = 40, + dup = 41, + pipe = 42, + times = 43, + prof = 44, + brk = 45, + setgid = 46, + getgid = 47, + signal = 48, + geteuid = 49, + getegid = 50, + acct = 51, + umount2 = 52, + lock = 53, + ioctl = 54, + fcntl = 55, + mpx = 56, + setpgid = 57, + ulimit = 58, + oldolduname = 59, + umask = 60, + chroot = 61, + ustat = 62, + dup2 = 63, + getppid = 64, + getpgrp = 65, + setsid = 66, + sigaction = 67, + sgetmask = 68, + ssetmask = 69, + setreuid = 70, + setregid = 71, + sigsuspend = 72, + sigpending = 73, + sethostname = 74, + setrlimit = 75, + getrlimit = 76, + getrusage = 77, + gettimeofday = 78, + settimeofday = 79, + getgroups = 80, + setgroups = 81, + select = 82, + symlink = 83, + oldlstat = 84, + readlink = 85, + uselib = 86, + swapon = 87, + reboot = 88, + readdir = 89, + mmap = 90, + munmap = 91, + truncate = 92, + ftruncate = 93, + fchmod = 94, + fchown = 95, + getpriority = 96, + setpriority = 97, + profil = 98, + statfs = 99, + fstatfs = 100, + ioperm = 101, + socketcall = 102, + syslog = 103, + setitimer = 104, + getitimer = 105, + stat = 106, + lstat = 107, + fstat = 108, + olduname = 109, + iopl = 110, + vhangup = 111, + idle = 112, + vm86old = 113, + wait4 = 114, + swapoff = 115, + sysinfo = 116, + ipc = 117, + fsync = 118, + sigreturn = 119, + clone = 120, + setdomainname = 121, + uname = 122, + modify_ldt = 123, + adjtimex = 124, + mprotect = 125, + sigprocmask = 126, + create_module = 127, + init_module = 128, + delete_module = 129, + get_kernel_syms = 130, + quotactl = 131, + getpgid = 132, + fchdir = 133, + bdflush = 134, + sysfs = 135, + personality = 136, + afs_syscall = 137, + setfsuid = 138, + setfsgid = 139, + _llseek = 140, + getdents = 141, + _newselect = 142, + flock = 143, + msync = 144, + readv = 145, + writev = 146, + getsid = 147, + fdatasync = 148, + _sysctl = 149, + mlock = 150, + munlock = 151, + mlockall = 152, + munlockall = 153, + sched_setparam = 154, + sched_getparam = 155, + sched_setscheduler = 156, + sched_getscheduler = 157, + sched_yield = 158, + sched_get_priority_max = 159, + sched_get_priority_min = 160, + sched_rr_get_interval = 161, + nanosleep = 162, + mremap = 163, + setresuid = 164, + getresuid = 165, + vm86 = 166, + query_module = 167, + poll = 168, + nfsservctl = 169, + setresgid = 170, + getresgid = 171, + prctl = 172, + rt_sigreturn = 173, + rt_sigaction = 174, + rt_sigprocmask = 175, + rt_sigpending = 176, + rt_sigtimedwait = 177, + rt_sigqueueinfo = 178, + rt_sigsuspend = 179, + pread64 = 180, + pwrite64 = 181, + chown = 182, + getcwd = 183, + capget = 184, + capset = 185, + sigaltstack = 186, + sendfile = 187, + getpmsg = 188, + putpmsg = 189, + vfork = 190, + ugetrlimit = 191, + mmap2 = 192, + truncate64 = 193, + ftruncate64 = 194, + stat64 = 195, + lstat64 = 196, + fstat64 = 197, + lchown32 = 198, + getuid32 = 199, + getgid32 = 200, + geteuid32 = 201, + getegid32 = 202, + setreuid32 = 203, + setregid32 = 204, + getgroups32 = 205, + setgroups32 = 206, + fchown32 = 207, + setresuid32 = 208, + getresuid32 = 209, + setresgid32 = 210, + getresgid32 = 211, + chown32 = 212, + setuid32 = 213, + setgid32 = 214, + setfsuid32 = 215, + setfsgid32 = 216, + pivot_root = 217, + mincore = 218, + madvise = 219, + getdents64 = 220, + fcntl64 = 221, + gettid = 224, + readahead = 225, + setxattr = 226, + lsetxattr = 227, + fsetxattr = 228, + getxattr = 229, + lgetxattr = 230, + fgetxattr = 231, + listxattr = 232, + llistxattr = 233, + flistxattr = 234, + removexattr = 235, + lremovexattr = 236, + fremovexattr = 237, + tkill = 238, + sendfile64 = 239, + futex = 240, + sched_setaffinity = 241, + sched_getaffinity = 242, + set_thread_area = 243, + get_thread_area = 244, + io_setup = 245, + io_destroy = 246, + io_getevents = 247, + io_submit = 248, + io_cancel = 249, + fadvise64 = 250, + exit_group = 252, + lookup_dcookie = 253, + epoll_create = 254, + epoll_ctl = 255, + epoll_wait = 256, + remap_file_pages = 257, + set_tid_address = 258, + timer_create = 259, + timer_settime, // SYS_timer_create + 1 + timer_gettime, // SYS_timer_create + 2 + timer_getoverrun, // SYS_timer_create + 3 + timer_delete, // SYS_timer_create + 4 + clock_settime, // SYS_timer_create + 5 + clock_gettime, // SYS_timer_create + 6 + clock_getres, // SYS_timer_create + 7 + clock_nanosleep, // SYS_timer_create + 8 + statfs64 = 268, + fstatfs64 = 269, + tgkill = 270, + utimes = 271, + fadvise64_64 = 272, + vserver = 273, + mbind = 274, + get_mempolicy = 275, + set_mempolicy = 276, + mq_open = 277, + mq_unlink, // SYS_mq_open + 1 + mq_timedsend, // SYS_mq_open + 2 + mq_timedreceive, // SYS_mq_open + 3 + mq_notify, // SYS_mq_open + 4 + mq_getsetattr, // SYS_mq_open + 5 + kexec_load = 283, + waitid = 284, + add_key = 286, + request_key = 287, + keyctl = 288, + ioprio_set = 289, + ioprio_get = 290, + inotify_init = 291, + inotify_add_watch = 292, + inotify_rm_watch = 293, + migrate_pages = 294, + openat = 295, + mkdirat = 296, + mknodat = 297, + fchownat = 298, + futimesat = 299, + fstatat64 = 300, + unlinkat = 301, + renameat = 302, + linkat = 303, + symlinkat = 304, + readlinkat = 305, + fchmodat = 306, + faccessat = 307, + pselect6 = 308, + ppoll = 309, + unshare = 310, + set_robust_list = 311, + get_robust_list = 312, + splice = 313, + sync_file_range = 314, + tee = 315, + vmsplice = 316, + move_pages = 317, + getcpu = 318, + epoll_pwait = 319, + utimensat = 320, + signalfd = 321, + timerfd_create = 322, + eventfd = 323, + fallocate = 324, + timerfd_settime = 325, + timerfd_gettime = 326, + signalfd4 = 327, + eventfd2 = 328, + epoll_create1 = 329, + dup3 = 330, + pipe2 = 331, + inotify_init1 = 332, + preadv = 333, + pwritev = 334, + rt_tgsigqueueinfo = 335, + perf_event_open = 336, + recvmmsg = 337, + fanotify_init = 338, + fanotify_mark = 339, + prlimit64 = 340, + name_to_handle_at = 341, + open_by_handle_at = 342, + clock_adjtime = 343, + syncfs = 344, + sendmmsg = 345, + setns = 346, + process_vm_readv = 347, + process_vm_writev = 348, + kcmp = 349, + finit_module = 350, + sched_setattr = 351, + sched_getattr = 352, + renameat2 = 353, + seccomp = 354, + getrandom = 355, + memfd_create = 356, + bpf = 357, + execveat = 358, + socket = 359, + socketpair = 360, + bind = 361, + connect = 362, + listen = 363, + accept4 = 364, + getsockopt = 365, + setsockopt = 366, + getsockname = 367, + getpeername = 368, + sendto = 369, + sendmsg = 370, + recvfrom = 371, + recvmsg = 372, + shutdown = 373, + userfaultfd = 374, + membarrier = 375, + mlock2 = 376, + copy_file_range = 377, + preadv2 = 378, + pwritev2 = 379, + pkey_mprotect = 380, + pkey_alloc = 381, + pkey_free = 382, + statx = 383, + arch_prctl = 384, + io_pgetevents = 385, + rseq = 386, + semget = 393, + semctl = 394, + shmget = 395, + shmctl = 396, + shmat = 397, + shmdt = 398, + msgget = 399, + msgsnd = 400, + msgrcv = 401, + msgctl = 402, + clock_gettime64 = 403, + clock_settime64 = 404, + clock_adjtime64 = 405, + clock_getres_time64 = 406, + clock_nanosleep_time64 = 407, + timer_gettime64 = 408, + timer_settime64 = 409, + timerfd_gettime64 = 410, + timerfd_settime64 = 411, + utimensat_time64 = 412, + pselect6_time64 = 413, + ppoll_time64 = 414, + io_pgetevents_time64 = 416, + recvmmsg_time64 = 417, + mq_timedsend_time64 = 418, + mq_timedreceive_time64 = 419, + semtimedop_time64 = 420, + rt_sigtimedwait_time64 = 421, + futex_time64 = 422, + sched_rr_get_interval_time64 = 423, + pidfd_send_signal = 424, + io_uring_setup = 425, + io_uring_enter = 426, + io_uring_register = 427, + open_tree = 428, + move_mount = 429, + fsopen = 430, + fsconfig = 431, + fsmount = 432, + fspick = 433, + openat2 = 437, + pidfd_getfd = 438, + + _, +}; pub const O_CREAT = 0o100; pub const O_EXCL = 0o200; diff --git a/lib/std/os/bits/linux/mipsel.zig b/lib/std/os/bits/linux/mipsel.zig index 4ef7619745..d1f088be40 100644 --- a/lib/std/os/bits/linux/mipsel.zig +++ b/lib/std/os/bits/linux/mipsel.zig @@ -6,377 +6,382 @@ const iovec_const = linux.iovec_const; const uid_t = linux.uid_t; const gid_t = linux.gid_t; -pub const SYS_Linux = 4000; -pub const SYS_syscall = (SYS_Linux + 0); -pub const SYS_exit = (SYS_Linux + 1); -pub const SYS_fork = (SYS_Linux + 2); -pub const SYS_read = (SYS_Linux + 3); -pub const SYS_write = (SYS_Linux + 4); -pub const SYS_open = (SYS_Linux + 5); -pub const SYS_close = (SYS_Linux + 6); -pub const SYS_waitpid = (SYS_Linux + 7); -pub const SYS_creat = (SYS_Linux + 8); -pub const SYS_link = (SYS_Linux + 9); -pub const SYS_unlink = (SYS_Linux + 10); -pub const SYS_execve = (SYS_Linux + 11); -pub const SYS_chdir = (SYS_Linux + 12); -pub const SYS_time = (SYS_Linux + 13); -pub const SYS_mknod = (SYS_Linux + 14); -pub const SYS_chmod = (SYS_Linux + 15); -pub const SYS_lchown = (SYS_Linux + 16); -pub const SYS_break = (SYS_Linux + 17); -pub const SYS_unused18 = (SYS_Linux + 18); -pub const SYS_lseek = (SYS_Linux + 19); -pub const SYS_getpid = (SYS_Linux + 20); -pub const SYS_mount = (SYS_Linux + 21); -pub const SYS_umount = (SYS_Linux + 22); -pub const SYS_setuid = (SYS_Linux + 23); -pub const SYS_getuid = (SYS_Linux + 24); -pub const SYS_stime = (SYS_Linux + 25); -pub const SYS_ptrace = (SYS_Linux + 26); -pub const SYS_alarm = (SYS_Linux + 27); -pub const SYS_unused28 = (SYS_Linux + 28); -pub const SYS_pause = (SYS_Linux + 29); -pub const SYS_utime = (SYS_Linux + 30); -pub const SYS_stty = (SYS_Linux + 31); -pub const SYS_gtty = (SYS_Linux + 32); -pub const SYS_access = (SYS_Linux + 33); -pub const SYS_nice = (SYS_Linux + 34); -pub const SYS_ftime = (SYS_Linux + 35); -pub const SYS_sync = (SYS_Linux + 36); -pub const SYS_kill = (SYS_Linux + 37); -pub const SYS_rename = (SYS_Linux + 38); -pub const SYS_mkdir = (SYS_Linux + 39); -pub const SYS_rmdir = (SYS_Linux + 40); -pub const SYS_dup = (SYS_Linux + 41); -pub const SYS_pipe = (SYS_Linux + 42); -pub const SYS_times = (SYS_Linux + 43); -pub const SYS_prof = (SYS_Linux + 44); -pub const SYS_brk = (SYS_Linux + 45); -pub const SYS_setgid = (SYS_Linux + 46); -pub const SYS_getgid = (SYS_Linux + 47); -pub const SYS_signal = (SYS_Linux + 48); -pub const SYS_geteuid = (SYS_Linux + 49); -pub const SYS_getegid = (SYS_Linux + 50); -pub const SYS_acct = (SYS_Linux + 51); -pub const SYS_umount2 = (SYS_Linux + 52); -pub const SYS_lock = (SYS_Linux + 53); -pub const SYS_ioctl = (SYS_Linux + 54); -pub const SYS_fcntl = (SYS_Linux + 55); -pub const SYS_mpx = (SYS_Linux + 56); -pub const SYS_setpgid = (SYS_Linux + 57); -pub const SYS_ulimit = (SYS_Linux + 58); -pub const SYS_unused59 = (SYS_Linux + 59); -pub const SYS_umask = (SYS_Linux + 60); -pub const SYS_chroot = (SYS_Linux + 61); -pub const SYS_ustat = (SYS_Linux + 62); -pub const SYS_dup2 = (SYS_Linux + 63); -pub const SYS_getppid = (SYS_Linux + 64); -pub const SYS_getpgrp = (SYS_Linux + 65); -pub const SYS_setsid = (SYS_Linux + 66); -pub const SYS_sigaction = (SYS_Linux + 67); -pub const SYS_sgetmask = (SYS_Linux + 68); -pub const SYS_ssetmask = (SYS_Linux + 69); -pub const SYS_setreuid = (SYS_Linux + 70); -pub const SYS_setregid = (SYS_Linux + 71); -pub const SYS_sigsuspend = (SYS_Linux + 72); -pub const SYS_sigpending = (SYS_Linux + 73); -pub const SYS_sethostname = (SYS_Linux + 74); -pub const SYS_setrlimit = (SYS_Linux + 75); -pub const SYS_getrlimit = (SYS_Linux + 76); -pub const SYS_getrusage = (SYS_Linux + 77); -pub const SYS_gettimeofday = (SYS_Linux + 78); -pub const SYS_settimeofday = (SYS_Linux + 79); -pub const SYS_getgroups = (SYS_Linux + 80); -pub const SYS_setgroups = (SYS_Linux + 81); -pub const SYS_reserved82 = (SYS_Linux + 82); -pub const SYS_symlink = (SYS_Linux + 83); -pub const SYS_unused84 = (SYS_Linux + 84); -pub const SYS_readlink = (SYS_Linux + 85); -pub const SYS_uselib = (SYS_Linux + 86); -pub const SYS_swapon = (SYS_Linux + 87); -pub const SYS_reboot = (SYS_Linux + 88); -pub const SYS_readdir = (SYS_Linux + 89); -pub const SYS_mmap = (SYS_Linux + 90); -pub const SYS_munmap = (SYS_Linux + 91); -pub const SYS_truncate = (SYS_Linux + 92); -pub const SYS_ftruncate = (SYS_Linux + 93); -pub const SYS_fchmod = (SYS_Linux + 94); -pub const SYS_fchown = (SYS_Linux + 95); -pub const SYS_getpriority = (SYS_Linux + 96); -pub const SYS_setpriority = (SYS_Linux + 97); -pub const SYS_profil = (SYS_Linux + 98); -pub const SYS_statfs = (SYS_Linux + 99); -pub const SYS_fstatfs = (SYS_Linux + 100); -pub const SYS_ioperm = (SYS_Linux + 101); -pub const SYS_socketcall = (SYS_Linux + 102); -pub const SYS_syslog = (SYS_Linux + 103); -pub const SYS_setitimer = (SYS_Linux + 104); -pub const SYS_getitimer = (SYS_Linux + 105); -pub const SYS_stat = (SYS_Linux + 106); -pub const SYS_lstat = (SYS_Linux + 107); -pub const SYS_fstat = (SYS_Linux + 108); -pub const SYS_unused109 = (SYS_Linux + 109); -pub const SYS_iopl = (SYS_Linux + 110); -pub const SYS_vhangup = (SYS_Linux + 111); -pub const SYS_idle = (SYS_Linux + 112); -pub const SYS_vm86 = (SYS_Linux + 113); -pub const SYS_wait4 = (SYS_Linux + 114); -pub const SYS_swapoff = (SYS_Linux + 115); -pub const SYS_sysinfo = (SYS_Linux + 116); -pub const SYS_ipc = (SYS_Linux + 117); -pub const SYS_fsync = (SYS_Linux + 118); -pub const SYS_sigreturn = (SYS_Linux + 119); -pub const SYS_clone = (SYS_Linux + 120); -pub const SYS_setdomainname = (SYS_Linux + 121); -pub const SYS_uname = (SYS_Linux + 122); -pub const SYS_modify_ldt = (SYS_Linux + 123); -pub const SYS_adjtimex = (SYS_Linux + 124); -pub const SYS_mprotect = (SYS_Linux + 125); -pub const SYS_sigprocmask = (SYS_Linux + 126); -pub const SYS_create_module = (SYS_Linux + 127); -pub const SYS_init_module = (SYS_Linux + 128); -pub const SYS_delete_module = (SYS_Linux + 129); -pub const SYS_get_kernel_syms = (SYS_Linux + 130); -pub const SYS_quotactl = (SYS_Linux + 131); -pub const SYS_getpgid = (SYS_Linux + 132); -pub const SYS_fchdir = (SYS_Linux + 133); -pub const SYS_bdflush = (SYS_Linux + 134); -pub const SYS_sysfs = (SYS_Linux + 135); -pub const SYS_personality = (SYS_Linux + 136); -pub const SYS_afs_syscall = (SYS_Linux + 137); -pub const SYS_setfsuid = (SYS_Linux + 138); -pub const SYS_setfsgid = (SYS_Linux + 139); -pub const SYS__llseek = (SYS_Linux + 140); -pub const SYS_getdents = (SYS_Linux + 141); -pub const SYS__newselect = (SYS_Linux + 142); -pub const SYS_flock = (SYS_Linux + 143); -pub const SYS_msync = (SYS_Linux + 144); -pub const SYS_readv = (SYS_Linux + 145); -pub const SYS_writev = (SYS_Linux + 146); -pub const SYS_cacheflush = (SYS_Linux + 147); -pub const SYS_cachectl = (SYS_Linux + 148); -pub const SYS_sysmips = (SYS_Linux + 149); -pub const SYS_unused150 = (SYS_Linux + 150); -pub const SYS_getsid = (SYS_Linux + 151); -pub const SYS_fdatasync = (SYS_Linux + 152); -pub const SYS__sysctl = (SYS_Linux + 153); -pub const SYS_mlock = (SYS_Linux + 154); -pub const SYS_munlock = (SYS_Linux + 155); -pub const SYS_mlockall = (SYS_Linux + 156); -pub const SYS_munlockall = (SYS_Linux + 157); -pub const SYS_sched_setparam = (SYS_Linux + 158); -pub const SYS_sched_getparam = (SYS_Linux + 159); -pub const SYS_sched_setscheduler = (SYS_Linux + 160); -pub const SYS_sched_getscheduler = (SYS_Linux + 161); -pub const SYS_sched_yield = (SYS_Linux + 162); -pub const SYS_sched_get_priority_max = (SYS_Linux + 163); -pub const SYS_sched_get_priority_min = (SYS_Linux + 164); -pub const SYS_sched_rr_get_interval = (SYS_Linux + 165); -pub const SYS_nanosleep = (SYS_Linux + 166); -pub const SYS_mremap = (SYS_Linux + 167); -pub const SYS_accept = (SYS_Linux + 168); -pub const SYS_bind = (SYS_Linux + 169); -pub const SYS_connect = (SYS_Linux + 170); -pub const SYS_getpeername = (SYS_Linux + 171); -pub const SYS_getsockname = (SYS_Linux + 172); -pub const SYS_getsockopt = (SYS_Linux + 173); -pub const SYS_listen = (SYS_Linux + 174); -pub const SYS_recv = (SYS_Linux + 175); -pub const SYS_recvfrom = (SYS_Linux + 176); -pub const SYS_recvmsg = (SYS_Linux + 177); -pub const SYS_send = (SYS_Linux + 178); -pub const SYS_sendmsg = (SYS_Linux + 179); -pub const SYS_sendto = (SYS_Linux + 180); -pub const SYS_setsockopt = (SYS_Linux + 181); -pub const SYS_shutdown = (SYS_Linux + 182); -pub const SYS_socket = (SYS_Linux + 183); -pub const SYS_socketpair = (SYS_Linux + 184); -pub const SYS_setresuid = (SYS_Linux + 185); -pub const SYS_getresuid = (SYS_Linux + 186); -pub const SYS_query_module = (SYS_Linux + 187); -pub const SYS_poll = (SYS_Linux + 188); -pub const SYS_nfsservctl = (SYS_Linux + 189); -pub const SYS_setresgid = (SYS_Linux + 190); -pub const SYS_getresgid = (SYS_Linux + 191); -pub const SYS_prctl = (SYS_Linux + 192); -pub const SYS_rt_sigreturn = (SYS_Linux + 193); -pub const SYS_rt_sigaction = (SYS_Linux + 194); -pub const SYS_rt_sigprocmask = (SYS_Linux + 195); -pub const SYS_rt_sigpending = (SYS_Linux + 196); -pub const SYS_rt_sigtimedwait = (SYS_Linux + 197); -pub const SYS_rt_sigqueueinfo = (SYS_Linux + 198); -pub const SYS_rt_sigsuspend = (SYS_Linux + 199); -pub const SYS_pread64 = (SYS_Linux + 200); -pub const SYS_pwrite64 = (SYS_Linux + 201); -pub const SYS_chown = (SYS_Linux + 202); -pub const SYS_getcwd = (SYS_Linux + 203); -pub const SYS_capget = (SYS_Linux + 204); -pub const SYS_capset = (SYS_Linux + 205); -pub const SYS_sigaltstack = (SYS_Linux + 206); -pub const SYS_sendfile = (SYS_Linux + 207); -pub const SYS_getpmsg = (SYS_Linux + 208); -pub const SYS_putpmsg = (SYS_Linux + 209); -pub const SYS_mmap2 = (SYS_Linux + 210); -pub const SYS_truncate64 = (SYS_Linux + 211); -pub const SYS_ftruncate64 = (SYS_Linux + 212); -pub const SYS_stat64 = (SYS_Linux + 213); -pub const SYS_lstat64 = (SYS_Linux + 214); -pub const SYS_fstat64 = (SYS_Linux + 215); -pub const SYS_pivot_root = (SYS_Linux + 216); -pub const SYS_mincore = (SYS_Linux + 217); -pub const SYS_madvise = (SYS_Linux + 218); -pub const SYS_getdents64 = (SYS_Linux + 219); -pub const SYS_fcntl64 = (SYS_Linux + 220); -pub const SYS_reserved221 = (SYS_Linux + 221); -pub const SYS_gettid = (SYS_Linux + 222); -pub const SYS_readahead = (SYS_Linux + 223); -pub const SYS_setxattr = (SYS_Linux + 224); -pub const SYS_lsetxattr = (SYS_Linux + 225); -pub const SYS_fsetxattr = (SYS_Linux + 226); -pub const SYS_getxattr = (SYS_Linux + 227); -pub const SYS_lgetxattr = (SYS_Linux + 228); -pub const SYS_fgetxattr = (SYS_Linux + 229); -pub const SYS_listxattr = (SYS_Linux + 230); -pub const SYS_llistxattr = (SYS_Linux + 231); -pub const SYS_flistxattr = (SYS_Linux + 232); -pub const SYS_removexattr = (SYS_Linux + 233); -pub const SYS_lremovexattr = (SYS_Linux + 234); -pub const SYS_fremovexattr = (SYS_Linux + 235); -pub const SYS_tkill = (SYS_Linux + 236); -pub const SYS_sendfile64 = (SYS_Linux + 237); -pub const SYS_futex = (SYS_Linux + 238); -pub const SYS_sched_setaffinity = (SYS_Linux + 239); -pub const SYS_sched_getaffinity = (SYS_Linux + 240); -pub const SYS_io_setup = (SYS_Linux + 241); -pub const SYS_io_destroy = (SYS_Linux + 242); -pub const SYS_io_getevents = (SYS_Linux + 243); -pub const SYS_io_submit = (SYS_Linux + 244); -pub const SYS_io_cancel = (SYS_Linux + 245); -pub const SYS_exit_group = (SYS_Linux + 246); -pub const SYS_lookup_dcookie = (SYS_Linux + 247); -pub const SYS_epoll_create = (SYS_Linux + 248); -pub const SYS_epoll_ctl = (SYS_Linux + 249); -pub const SYS_epoll_wait = (SYS_Linux + 250); -pub const SYS_remap_file_pages = (SYS_Linux + 251); -pub const SYS_set_tid_address = (SYS_Linux + 252); -pub const SYS_restart_syscall = (SYS_Linux + 253); -pub const SYS_fadvise64 = (SYS_Linux + 254); -pub const SYS_statfs64 = (SYS_Linux + 255); -pub const SYS_fstatfs64 = (SYS_Linux + 256); -pub const SYS_timer_create = (SYS_Linux + 257); -pub const SYS_timer_settime = (SYS_Linux + 258); -pub const SYS_timer_gettime = (SYS_Linux + 259); -pub const SYS_timer_getoverrun = (SYS_Linux + 260); -pub const SYS_timer_delete = (SYS_Linux + 261); -pub const SYS_clock_settime = (SYS_Linux + 262); -pub const SYS_clock_gettime = (SYS_Linux + 263); -pub const SYS_clock_getres = (SYS_Linux + 264); -pub const SYS_clock_nanosleep = (SYS_Linux + 265); -pub const SYS_tgkill = (SYS_Linux + 266); -pub const SYS_utimes = (SYS_Linux + 267); -pub const SYS_mbind = (SYS_Linux + 268); -pub const SYS_get_mempolicy = (SYS_Linux + 269); -pub const SYS_set_mempolicy = (SYS_Linux + 270); -pub const SYS_mq_open = (SYS_Linux + 271); -pub const SYS_mq_unlink = (SYS_Linux + 272); -pub const SYS_mq_timedsend = (SYS_Linux + 273); -pub const SYS_mq_timedreceive = (SYS_Linux + 274); -pub const SYS_mq_notify = (SYS_Linux + 275); -pub const SYS_mq_getsetattr = (SYS_Linux + 276); -pub const SYS_vserver = (SYS_Linux + 277); -pub const SYS_waitid = (SYS_Linux + 278); -pub const SYS_add_key = (SYS_Linux + 280); -pub const SYS_request_key = (SYS_Linux + 281); -pub const SYS_keyctl = (SYS_Linux + 282); -pub const SYS_set_thread_area = (SYS_Linux + 283); -pub const SYS_inotify_init = (SYS_Linux + 284); -pub const SYS_inotify_add_watch = (SYS_Linux + 285); -pub const SYS_inotify_rm_watch = (SYS_Linux + 286); -pub const SYS_migrate_pages = (SYS_Linux + 287); -pub const SYS_openat = (SYS_Linux + 288); -pub const SYS_mkdirat = (SYS_Linux + 289); -pub const SYS_mknodat = (SYS_Linux + 290); -pub const SYS_fchownat = (SYS_Linux + 291); -pub const SYS_futimesat = (SYS_Linux + 292); -pub const SYS_fstatat64 = (SYS_Linux + 293); -pub const SYS_unlinkat = (SYS_Linux + 294); -pub const SYS_renameat = (SYS_Linux + 295); -pub const SYS_linkat = (SYS_Linux + 296); -pub const SYS_symlinkat = (SYS_Linux + 297); -pub const SYS_readlinkat = (SYS_Linux + 298); -pub const SYS_fchmodat = (SYS_Linux + 299); -pub const SYS_faccessat = (SYS_Linux + 300); -pub const SYS_pselect6 = (SYS_Linux + 301); -pub const SYS_ppoll = (SYS_Linux + 302); -pub const SYS_unshare = (SYS_Linux + 303); -pub const SYS_splice = (SYS_Linux + 304); -pub const SYS_sync_file_range = (SYS_Linux + 305); -pub const SYS_tee = (SYS_Linux + 306); -pub const SYS_vmsplice = (SYS_Linux + 307); -pub const SYS_move_pages = (SYS_Linux + 308); -pub const SYS_set_robust_list = (SYS_Linux + 309); -pub const SYS_get_robust_list = (SYS_Linux + 310); -pub const SYS_kexec_load = (SYS_Linux + 311); -pub const SYS_getcpu = (SYS_Linux + 312); -pub const SYS_epoll_pwait = (SYS_Linux + 313); -pub const SYS_ioprio_set = (SYS_Linux + 314); -pub const SYS_ioprio_get = (SYS_Linux + 315); -pub const SYS_utimensat = (SYS_Linux + 316); -pub const SYS_signalfd = (SYS_Linux + 317); -pub const SYS_timerfd = (SYS_Linux + 318); -pub const SYS_eventfd = (SYS_Linux + 319); -pub const SYS_fallocate = (SYS_Linux + 320); -pub const SYS_timerfd_create = (SYS_Linux + 321); -pub const SYS_timerfd_gettime = (SYS_Linux + 322); -pub const SYS_timerfd_settime = (SYS_Linux + 323); -pub const SYS_signalfd4 = (SYS_Linux + 324); -pub const SYS_eventfd2 = (SYS_Linux + 325); -pub const SYS_epoll_create1 = (SYS_Linux + 326); -pub const SYS_dup3 = (SYS_Linux + 327); -pub const SYS_pipe2 = (SYS_Linux + 328); -pub const SYS_inotify_init1 = (SYS_Linux + 329); -pub const SYS_preadv = (SYS_Linux + 330); -pub const SYS_pwritev = (SYS_Linux + 331); -pub const SYS_rt_tgsigqueueinfo = (SYS_Linux + 332); -pub const SYS_perf_event_open = (SYS_Linux + 333); -pub const SYS_accept4 = (SYS_Linux + 334); -pub const SYS_recvmmsg = (SYS_Linux + 335); -pub const SYS_fanotify_init = (SYS_Linux + 336); -pub const SYS_fanotify_mark = (SYS_Linux + 337); -pub const SYS_prlimit64 = (SYS_Linux + 338); -pub const SYS_name_to_handle_at = (SYS_Linux + 339); -pub const SYS_open_by_handle_at = (SYS_Linux + 340); -pub const SYS_clock_adjtime = (SYS_Linux + 341); -pub const SYS_syncfs = (SYS_Linux + 342); -pub const SYS_sendmmsg = (SYS_Linux + 343); -pub const SYS_setns = (SYS_Linux + 344); -pub const SYS_process_vm_readv = (SYS_Linux + 345); -pub const SYS_process_vm_writev = (SYS_Linux + 346); -pub const SYS_kcmp = (SYS_Linux + 347); -pub const SYS_finit_module = (SYS_Linux + 348); -pub const SYS_sched_setattr = (SYS_Linux + 349); -pub const SYS_sched_getattr = (SYS_Linux + 350); -pub const SYS_renameat2 = (SYS_Linux + 351); -pub const SYS_seccomp = (SYS_Linux + 352); -pub const SYS_getrandom = (SYS_Linux + 353); -pub const SYS_memfd_create = (SYS_Linux + 354); -pub const SYS_bpf = (SYS_Linux + 355); -pub const SYS_execveat = (SYS_Linux + 356); -pub const SYS_userfaultfd = (SYS_Linux + 357); -pub const SYS_membarrier = (SYS_Linux + 358); -pub const SYS_mlock2 = (SYS_Linux + 359); -pub const SYS_copy_file_range = (SYS_Linux + 360); -pub const SYS_preadv2 = (SYS_Linux + 361); -pub const SYS_pwritev2 = (SYS_Linux + 362); -pub const SYS_pkey_mprotect = (SYS_Linux + 363); -pub const SYS_pkey_alloc = (SYS_Linux + 364); -pub const SYS_pkey_free = (SYS_Linux + 365); -pub const SYS_statx = (SYS_Linux + 366); -pub const SYS_rseq = (SYS_Linux + 367); -pub const SYS_io_pgetevents = (SYS_Linux + 368); -pub const SYS_openat2 = (SYS_Linux + 437); -pub const SYS_pidfd_getfd = (SYS_Linux + 438); +pub const SYS = extern enum(usize) { + pub const Linux = 4000; + + syscall = Linux + 0, + exit = Linux + 1, + fork = Linux + 2, + read = Linux + 3, + write = Linux + 4, + open = Linux + 5, + close = Linux + 6, + waitpid = Linux + 7, + creat = Linux + 8, + link = Linux + 9, + unlink = Linux + 10, + execve = Linux + 11, + chdir = Linux + 12, + time = Linux + 13, + mknod = Linux + 14, + chmod = Linux + 15, + lchown = Linux + 16, + @"break" = Linux + 17, + unused18 = Linux + 18, + lseek = Linux + 19, + getpid = Linux + 20, + mount = Linux + 21, + umount = Linux + 22, + setuid = Linux + 23, + getuid = Linux + 24, + stime = Linux + 25, + ptrace = Linux + 26, + alarm = Linux + 27, + unused28 = Linux + 28, + pause = Linux + 29, + utime = Linux + 30, + stty = Linux + 31, + gtty = Linux + 32, + access = Linux + 33, + nice = Linux + 34, + ftime = Linux + 35, + sync = Linux + 36, + kill = Linux + 37, + rename = Linux + 38, + mkdir = Linux + 39, + rmdir = Linux + 40, + dup = Linux + 41, + pipe = Linux + 42, + times = Linux + 43, + prof = Linux + 44, + brk = Linux + 45, + setgid = Linux + 46, + getgid = Linux + 47, + signal = Linux + 48, + geteuid = Linux + 49, + getegid = Linux + 50, + acct = Linux + 51, + umount2 = Linux + 52, + lock = Linux + 53, + ioctl = Linux + 54, + fcntl = Linux + 55, + mpx = Linux + 56, + setpgid = Linux + 57, + ulimit = Linux + 58, + unused59 = Linux + 59, + umask = Linux + 60, + chroot = Linux + 61, + ustat = Linux + 62, + dup2 = Linux + 63, + getppid = Linux + 64, + getpgrp = Linux + 65, + setsid = Linux + 66, + sigaction = Linux + 67, + sgetmask = Linux + 68, + ssetmask = Linux + 69, + setreuid = Linux + 70, + setregid = Linux + 71, + sigsuspend = Linux + 72, + sigpending = Linux + 73, + sethostname = Linux + 74, + setrlimit = Linux + 75, + getrlimit = Linux + 76, + getrusage = Linux + 77, + gettimeofday = Linux + 78, + settimeofday = Linux + 79, + getgroups = Linux + 80, + setgroups = Linux + 81, + reserved82 = Linux + 82, + symlink = Linux + 83, + unused84 = Linux + 84, + readlink = Linux + 85, + uselib = Linux + 86, + swapon = Linux + 87, + reboot = Linux + 88, + readdir = Linux + 89, + mmap = Linux + 90, + munmap = Linux + 91, + truncate = Linux + 92, + ftruncate = Linux + 93, + fchmod = Linux + 94, + fchown = Linux + 95, + getpriority = Linux + 96, + setpriority = Linux + 97, + profil = Linux + 98, + statfs = Linux + 99, + fstatfs = Linux + 100, + ioperm = Linux + 101, + socketcall = Linux + 102, + syslog = Linux + 103, + setitimer = Linux + 104, + getitimer = Linux + 105, + stat = Linux + 106, + lstat = Linux + 107, + fstat = Linux + 108, + unused109 = Linux + 109, + iopl = Linux + 110, + vhangup = Linux + 111, + idle = Linux + 112, + vm86 = Linux + 113, + wait4 = Linux + 114, + swapoff = Linux + 115, + sysinfo = Linux + 116, + ipc = Linux + 117, + fsync = Linux + 118, + sigreturn = Linux + 119, + clone = Linux + 120, + setdomainname = Linux + 121, + uname = Linux + 122, + modify_ldt = Linux + 123, + adjtimex = Linux + 124, + mprotect = Linux + 125, + sigprocmask = Linux + 126, + create_module = Linux + 127, + init_module = Linux + 128, + delete_module = Linux + 129, + get_kernel_syms = Linux + 130, + quotactl = Linux + 131, + getpgid = Linux + 132, + fchdir = Linux + 133, + bdflush = Linux + 134, + sysfs = Linux + 135, + personality = Linux + 136, + afs_syscall = Linux + 137, + setfsuid = Linux + 138, + setfsgid = Linux + 139, + _llseek = Linux + 140, + getdents = Linux + 141, + _newselect = Linux + 142, + flock = Linux + 143, + msync = Linux + 144, + readv = Linux + 145, + writev = Linux + 146, + cacheflush = Linux + 147, + cachectl = Linux + 148, + sysmips = Linux + 149, + unused150 = Linux + 150, + getsid = Linux + 151, + fdatasync = Linux + 152, + _sysctl = Linux + 153, + mlock = Linux + 154, + munlock = Linux + 155, + mlockall = Linux + 156, + munlockall = Linux + 157, + sched_setparam = Linux + 158, + sched_getparam = Linux + 159, + sched_setscheduler = Linux + 160, + sched_getscheduler = Linux + 161, + sched_yield = Linux + 162, + sched_get_priority_max = Linux + 163, + sched_get_priority_min = Linux + 164, + sched_rr_get_interval = Linux + 165, + nanosleep = Linux + 166, + mremap = Linux + 167, + accept = Linux + 168, + bind = Linux + 169, + connect = Linux + 170, + getpeername = Linux + 171, + getsockname = Linux + 172, + getsockopt = Linux + 173, + listen = Linux + 174, + recv = Linux + 175, + recvfrom = Linux + 176, + recvmsg = Linux + 177, + send = Linux + 178, + sendmsg = Linux + 179, + sendto = Linux + 180, + setsockopt = Linux + 181, + shutdown = Linux + 182, + socket = Linux + 183, + socketpair = Linux + 184, + setresuid = Linux + 185, + getresuid = Linux + 186, + query_module = Linux + 187, + poll = Linux + 188, + nfsservctl = Linux + 189, + setresgid = Linux + 190, + getresgid = Linux + 191, + prctl = Linux + 192, + rt_sigreturn = Linux + 193, + rt_sigaction = Linux + 194, + rt_sigprocmask = Linux + 195, + rt_sigpending = Linux + 196, + rt_sigtimedwait = Linux + 197, + rt_sigqueueinfo = Linux + 198, + rt_sigsuspend = Linux + 199, + pread64 = Linux + 200, + pwrite64 = Linux + 201, + chown = Linux + 202, + getcwd = Linux + 203, + capget = Linux + 204, + capset = Linux + 205, + sigaltstack = Linux + 206, + sendfile = Linux + 207, + getpmsg = Linux + 208, + putpmsg = Linux + 209, + mmap2 = Linux + 210, + truncate64 = Linux + 211, + ftruncate64 = Linux + 212, + stat64 = Linux + 213, + lstat64 = Linux + 214, + fstat64 = Linux + 215, + pivot_root = Linux + 216, + mincore = Linux + 217, + madvise = Linux + 218, + getdents64 = Linux + 219, + fcntl64 = Linux + 220, + reserved221 = Linux + 221, + gettid = Linux + 222, + readahead = Linux + 223, + setxattr = Linux + 224, + lsetxattr = Linux + 225, + fsetxattr = Linux + 226, + getxattr = Linux + 227, + lgetxattr = Linux + 228, + fgetxattr = Linux + 229, + listxattr = Linux + 230, + llistxattr = Linux + 231, + flistxattr = Linux + 232, + removexattr = Linux + 233, + lremovexattr = Linux + 234, + fremovexattr = Linux + 235, + tkill = Linux + 236, + sendfile64 = Linux + 237, + futex = Linux + 238, + sched_setaffinity = Linux + 239, + sched_getaffinity = Linux + 240, + io_setup = Linux + 241, + io_destroy = Linux + 242, + io_getevents = Linux + 243, + io_submit = Linux + 244, + io_cancel = Linux + 245, + exit_group = Linux + 246, + lookup_dcookie = Linux + 247, + epoll_create = Linux + 248, + epoll_ctl = Linux + 249, + epoll_wait = Linux + 250, + remap_file_pages = Linux + 251, + set_tid_address = Linux + 252, + restart_syscall = Linux + 253, + fadvise64 = Linux + 254, + statfs64 = Linux + 255, + fstatfs64 = Linux + 256, + timer_create = Linux + 257, + timer_settime = Linux + 258, + timer_gettime = Linux + 259, + timer_getoverrun = Linux + 260, + timer_delete = Linux + 261, + clock_settime = Linux + 262, + clock_gettime = Linux + 263, + clock_getres = Linux + 264, + clock_nanosleep = Linux + 265, + tgkill = Linux + 266, + utimes = Linux + 267, + mbind = Linux + 268, + get_mempolicy = Linux + 269, + set_mempolicy = Linux + 270, + mq_open = Linux + 271, + mq_unlink = Linux + 272, + mq_timedsend = Linux + 273, + mq_timedreceive = Linux + 274, + mq_notify = Linux + 275, + mq_getsetattr = Linux + 276, + vserver = Linux + 277, + waitid = Linux + 278, + add_key = Linux + 280, + request_key = Linux + 281, + keyctl = Linux + 282, + set_thread_area = Linux + 283, + inotify_init = Linux + 284, + inotify_add_watch = Linux + 285, + inotify_rm_watch = Linux + 286, + migrate_pages = Linux + 287, + openat = Linux + 288, + mkdirat = Linux + 289, + mknodat = Linux + 290, + fchownat = Linux + 291, + futimesat = Linux + 292, + fstatat64 = Linux + 293, + unlinkat = Linux + 294, + renameat = Linux + 295, + linkat = Linux + 296, + symlinkat = Linux + 297, + readlinkat = Linux + 298, + fchmodat = Linux + 299, + faccessat = Linux + 300, + pselect6 = Linux + 301, + ppoll = Linux + 302, + unshare = Linux + 303, + splice = Linux + 304, + sync_file_range = Linux + 305, + tee = Linux + 306, + vmsplice = Linux + 307, + move_pages = Linux + 308, + set_robust_list = Linux + 309, + get_robust_list = Linux + 310, + kexec_load = Linux + 311, + getcpu = Linux + 312, + epoll_pwait = Linux + 313, + ioprio_set = Linux + 314, + ioprio_get = Linux + 315, + utimensat = Linux + 316, + signalfd = Linux + 317, + timerfd = Linux + 318, + eventfd = Linux + 319, + fallocate = Linux + 320, + timerfd_create = Linux + 321, + timerfd_gettime = Linux + 322, + timerfd_settime = Linux + 323, + signalfd4 = Linux + 324, + eventfd2 = Linux + 325, + epoll_create1 = Linux + 326, + dup3 = Linux + 327, + pipe2 = Linux + 328, + inotify_init1 = Linux + 329, + preadv = Linux + 330, + pwritev = Linux + 331, + rt_tgsigqueueinfo = Linux + 332, + perf_event_open = Linux + 333, + accept4 = Linux + 334, + recvmmsg = Linux + 335, + fanotify_init = Linux + 336, + fanotify_mark = Linux + 337, + prlimit64 = Linux + 338, + name_to_handle_at = Linux + 339, + open_by_handle_at = Linux + 340, + clock_adjtime = Linux + 341, + syncfs = Linux + 342, + sendmmsg = Linux + 343, + setns = Linux + 344, + process_vm_readv = Linux + 345, + process_vm_writev = Linux + 346, + kcmp = Linux + 347, + finit_module = Linux + 348, + sched_setattr = Linux + 349, + sched_getattr = Linux + 350, + renameat2 = Linux + 351, + seccomp = Linux + 352, + getrandom = Linux + 353, + memfd_create = Linux + 354, + bpf = Linux + 355, + execveat = Linux + 356, + userfaultfd = Linux + 357, + membarrier = Linux + 358, + mlock2 = Linux + 359, + copy_file_range = Linux + 360, + preadv2 = Linux + 361, + pwritev2 = Linux + 362, + pkey_mprotect = Linux + 363, + pkey_alloc = Linux + 364, + pkey_free = Linux + 365, + statx = Linux + 366, + rseq = Linux + 367, + io_pgetevents = Linux + 368, + openat2 = Linux + 437, + pidfd_getfd = Linux + 438, + + _, +}; pub const O_CREAT = 0o0400; pub const O_EXCL = 0o02000; diff --git a/lib/std/os/bits/linux/riscv64.zig b/lib/std/os/bits/linux/riscv64.zig index 75c67517e4..daeb3a7819 100644 --- a/lib/std/os/bits/linux/riscv64.zig +++ b/lib/std/os/bits/linux/riscv64.zig @@ -3,302 +3,306 @@ const std = @import("../../../std.zig"); const uid_t = std.os.linux.uid_t; const gid_t = std.os.linux.gid_t; -pub const SYS_io_setup = 0; -pub const SYS_io_destroy = 1; -pub const SYS_io_submit = 2; -pub const SYS_io_cancel = 3; -pub const SYS_io_getevents = 4; -pub const SYS_setxattr = 5; -pub const SYS_lsetxattr = 6; -pub const SYS_fsetxattr = 7; -pub const SYS_getxattr = 8; -pub const SYS_lgetxattr = 9; -pub const SYS_fgetxattr = 10; -pub const SYS_listxattr = 11; -pub const SYS_llistxattr = 12; -pub const SYS_flistxattr = 13; -pub const SYS_removexattr = 14; -pub const SYS_lremovexattr = 15; -pub const SYS_fremovexattr = 16; -pub const SYS_getcwd = 17; -pub const SYS_lookup_dcookie = 18; -pub const SYS_eventfd2 = 19; -pub const SYS_epoll_create1 = 20; -pub const SYS_epoll_ctl = 21; -pub const SYS_epoll_pwait = 22; -pub const SYS_dup = 23; -pub const SYS_dup3 = 24; -pub const SYS_fcntl = 25; -pub const SYS_inotify_init1 = 26; -pub const SYS_inotify_add_watch = 27; -pub const SYS_inotify_rm_watch = 28; -pub const SYS_ioctl = 29; -pub const SYS_ioprio_set = 30; -pub const SYS_ioprio_get = 31; -pub const SYS_flock = 32; -pub const SYS_mknodat = 33; -pub const SYS_mkdirat = 34; -pub const SYS_unlinkat = 35; -pub const SYS_symlinkat = 36; -pub const SYS_linkat = 37; -pub const SYS_umount2 = 39; -pub const SYS_mount = 40; -pub const SYS_pivot_root = 41; -pub const SYS_nfsservctl = 42; -pub const SYS_statfs = 43; -pub const SYS_fstatfs = 44; -pub const SYS_truncate = 45; -pub const SYS_ftruncate = 46; -pub const SYS_fallocate = 47; -pub const SYS_faccessat = 48; -pub const SYS_chdir = 49; -pub const SYS_fchdir = 50; -pub const SYS_chroot = 51; -pub const SYS_fchmod = 52; -pub const SYS_fchmodat = 53; -pub const SYS_fchownat = 54; -pub const SYS_fchown = 55; -pub const SYS_openat = 56; -pub const SYS_close = 57; -pub const SYS_vhangup = 58; -pub const SYS_pipe2 = 59; -pub const SYS_quotactl = 60; -pub const SYS_getdents64 = 61; -pub const SYS_lseek = 62; -pub const SYS_read = 63; -pub const SYS_write = 64; -pub const SYS_readv = 65; -pub const SYS_writev = 66; -pub const SYS_pread64 = 67; -pub const SYS_pwrite64 = 68; -pub const SYS_preadv = 69; -pub const SYS_pwritev = 70; -pub const SYS_sendfile = 71; -pub const SYS_pselect6 = 72; -pub const SYS_ppoll = 73; -pub const SYS_signalfd4 = 74; -pub const SYS_vmsplice = 75; -pub const SYS_splice = 76; -pub const SYS_tee = 77; -pub const SYS_readlinkat = 78; -pub const SYS_fstatat = 79; -pub const SYS_fstat = 80; -pub const SYS_sync = 81; -pub const SYS_fsync = 82; -pub const SYS_fdatasync = 83; -pub const SYS_sync_file_range = 84; -pub const SYS_timerfd_create = 85; -pub const SYS_timerfd_settime = 86; -pub const SYS_timerfd_gettime = 87; -pub const SYS_utimensat = 88; -pub const SYS_acct = 89; -pub const SYS_capget = 90; -pub const SYS_capset = 91; -pub const SYS_personality = 92; -pub const SYS_exit = 93; -pub const SYS_exit_group = 94; -pub const SYS_waitid = 95; -pub const SYS_set_tid_address = 96; -pub const SYS_unshare = 97; -pub const SYS_futex = 98; -pub const SYS_set_robust_list = 99; -pub const SYS_get_robust_list = 100; -pub const SYS_nanosleep = 101; -pub const SYS_getitimer = 102; -pub const SYS_setitimer = 103; -pub const SYS_kexec_load = 104; -pub const SYS_init_module = 105; -pub const SYS_delete_module = 106; -pub const SYS_timer_create = 107; -pub const SYS_timer_gettime = 108; -pub const SYS_timer_getoverrun = 109; -pub const SYS_timer_settime = 110; -pub const SYS_timer_delete = 111; -pub const SYS_clock_settime = 112; -pub const SYS_clock_gettime = 113; -pub const SYS_clock_getres = 114; -pub const SYS_clock_nanosleep = 115; -pub const SYS_syslog = 116; -pub const SYS_ptrace = 117; -pub const SYS_sched_setparam = 118; -pub const SYS_sched_setscheduler = 119; -pub const SYS_sched_getscheduler = 120; -pub const SYS_sched_getparam = 121; -pub const SYS_sched_setaffinity = 122; -pub const SYS_sched_getaffinity = 123; -pub const SYS_sched_yield = 124; -pub const SYS_sched_get_priority_max = 125; -pub const SYS_sched_get_priority_min = 126; -pub const SYS_sched_rr_get_interval = 127; -pub const SYS_restart_syscall = 128; -pub const SYS_kill = 129; -pub const SYS_tkill = 130; -pub const SYS_tgkill = 131; -pub const SYS_sigaltstack = 132; -pub const SYS_rt_sigsuspend = 133; -pub const SYS_rt_sigaction = 134; -pub const SYS_rt_sigprocmask = 135; -pub const SYS_rt_sigpending = 136; -pub const SYS_rt_sigtimedwait = 137; -pub const SYS_rt_sigqueueinfo = 138; -pub const SYS_rt_sigreturn = 139; -pub const SYS_setpriority = 140; -pub const SYS_getpriority = 141; -pub const SYS_reboot = 142; -pub const SYS_setregid = 143; -pub const SYS_setgid = 144; -pub const SYS_setreuid = 145; -pub const SYS_setuid = 146; -pub const SYS_setresuid = 147; -pub const SYS_getresuid = 148; -pub const SYS_setresgid = 149; -pub const SYS_getresgid = 150; -pub const SYS_setfsuid = 151; -pub const SYS_setfsgid = 152; -pub const SYS_times = 153; -pub const SYS_setpgid = 154; -pub const SYS_getpgid = 155; -pub const SYS_getsid = 156; -pub const SYS_setsid = 157; -pub const SYS_getgroups = 158; -pub const SYS_setgroups = 159; -pub const SYS_uname = 160; -pub const SYS_sethostname = 161; -pub const SYS_setdomainname = 162; -pub const SYS_getrlimit = 163; -pub const SYS_setrlimit = 164; -pub const SYS_getrusage = 165; -pub const SYS_umask = 166; -pub const SYS_prctl = 167; -pub const SYS_getcpu = 168; -pub const SYS_gettimeofday = 169; -pub const SYS_settimeofday = 170; -pub const SYS_adjtimex = 171; -pub const SYS_getpid = 172; -pub const SYS_getppid = 173; -pub const SYS_getuid = 174; -pub const SYS_geteuid = 175; -pub const SYS_getgid = 176; -pub const SYS_getegid = 177; -pub const SYS_gettid = 178; -pub const SYS_sysinfo = 179; -pub const SYS_mq_open = 180; -pub const SYS_mq_unlink = 181; -pub const SYS_mq_timedsend = 182; -pub const SYS_mq_timedreceive = 183; -pub const SYS_mq_notify = 184; -pub const SYS_mq_getsetattr = 185; -pub const SYS_msgget = 186; -pub const SYS_msgctl = 187; -pub const SYS_msgrcv = 188; -pub const SYS_msgsnd = 189; -pub const SYS_semget = 190; -pub const SYS_semctl = 191; -pub const SYS_semtimedop = 192; -pub const SYS_semop = 193; -pub const SYS_shmget = 194; -pub const SYS_shmctl = 195; -pub const SYS_shmat = 196; -pub const SYS_shmdt = 197; -pub const SYS_socket = 198; -pub const SYS_socketpair = 199; -pub const SYS_bind = 200; -pub const SYS_listen = 201; -pub const SYS_accept = 202; -pub const SYS_connect = 203; -pub const SYS_getsockname = 204; -pub const SYS_getpeername = 205; -pub const SYS_sendto = 206; -pub const SYS_recvfrom = 207; -pub const SYS_setsockopt = 208; -pub const SYS_getsockopt = 209; -pub const SYS_shutdown = 210; -pub const SYS_sendmsg = 211; -pub const SYS_recvmsg = 212; -pub const SYS_readahead = 213; -pub const SYS_brk = 214; -pub const SYS_munmap = 215; -pub const SYS_mremap = 216; -pub const SYS_add_key = 217; -pub const SYS_request_key = 218; -pub const SYS_keyctl = 219; -pub const SYS_clone = 220; -pub const SYS_execve = 221; -pub const SYS_mmap = 222; -pub const SYS_fadvise64 = 223; -pub const SYS_swapon = 224; -pub const SYS_swapoff = 225; -pub const SYS_mprotect = 226; -pub const SYS_msync = 227; -pub const SYS_mlock = 228; -pub const SYS_munlock = 229; -pub const SYS_mlockall = 230; -pub const SYS_munlockall = 231; -pub const SYS_mincore = 232; -pub const SYS_madvise = 233; -pub const SYS_remap_file_pages = 234; -pub const SYS_mbind = 235; -pub const SYS_get_mempolicy = 236; -pub const SYS_set_mempolicy = 237; -pub const SYS_migrate_pages = 238; -pub const SYS_move_pages = 239; -pub const SYS_rt_tgsigqueueinfo = 240; -pub const SYS_perf_event_open = 241; -pub const SYS_accept4 = 242; -pub const SYS_recvmmsg = 243; +pub const SYS = extern enum(usize) { + io_setup = 0, + io_destroy = 1, + io_submit = 2, + io_cancel = 3, + io_getevents = 4, + setxattr = 5, + lsetxattr = 6, + fsetxattr = 7, + getxattr = 8, + lgetxattr = 9, + fgetxattr = 10, + listxattr = 11, + llistxattr = 12, + flistxattr = 13, + removexattr = 14, + lremovexattr = 15, + fremovexattr = 16, + getcwd = 17, + lookup_dcookie = 18, + eventfd2 = 19, + epoll_create1 = 20, + epoll_ctl = 21, + epoll_pwait = 22, + dup = 23, + dup3 = 24, + fcntl = 25, + inotify_init1 = 26, + inotify_add_watch = 27, + inotify_rm_watch = 28, + ioctl = 29, + ioprio_set = 30, + ioprio_get = 31, + flock = 32, + mknodat = 33, + mkdirat = 34, + unlinkat = 35, + symlinkat = 36, + linkat = 37, + umount2 = 39, + mount = 40, + pivot_root = 41, + nfsservctl = 42, + statfs = 43, + fstatfs = 44, + truncate = 45, + ftruncate = 46, + fallocate = 47, + faccessat = 48, + chdir = 49, + fchdir = 50, + chroot = 51, + fchmod = 52, + fchmodat = 53, + fchownat = 54, + fchown = 55, + openat = 56, + close = 57, + vhangup = 58, + pipe2 = 59, + quotactl = 60, + getdents64 = 61, + lseek = 62, + read = 63, + write = 64, + readv = 65, + writev = 66, + pread64 = 67, + pwrite64 = 68, + preadv = 69, + pwritev = 70, + sendfile = 71, + pselect6 = 72, + ppoll = 73, + signalfd4 = 74, + vmsplice = 75, + splice = 76, + tee = 77, + readlinkat = 78, + fstatat = 79, + fstat = 80, + sync = 81, + fsync = 82, + fdatasync = 83, + sync_file_range = 84, + timerfd_create = 85, + timerfd_settime = 86, + timerfd_gettime = 87, + utimensat = 88, + acct = 89, + capget = 90, + capset = 91, + personality = 92, + exit = 93, + exit_group = 94, + waitid = 95, + set_tid_address = 96, + unshare = 97, + futex = 98, + set_robust_list = 99, + get_robust_list = 100, + nanosleep = 101, + getitimer = 102, + setitimer = 103, + kexec_load = 104, + init_module = 105, + delete_module = 106, + timer_create = 107, + timer_gettime = 108, + timer_getoverrun = 109, + timer_settime = 110, + timer_delete = 111, + clock_settime = 112, + clock_gettime = 113, + clock_getres = 114, + clock_nanosleep = 115, + syslog = 116, + ptrace = 117, + sched_setparam = 118, + sched_setscheduler = 119, + sched_getscheduler = 120, + sched_getparam = 121, + sched_setaffinity = 122, + sched_getaffinity = 123, + sched_yield = 124, + sched_get_priority_max = 125, + sched_get_priority_min = 126, + sched_rr_get_interval = 127, + restart_syscall = 128, + kill = 129, + tkill = 130, + tgkill = 131, + sigaltstack = 132, + rt_sigsuspend = 133, + rt_sigaction = 134, + rt_sigprocmask = 135, + rt_sigpending = 136, + rt_sigtimedwait = 137, + rt_sigqueueinfo = 138, + rt_sigreturn = 139, + setpriority = 140, + getpriority = 141, + reboot = 142, + setregid = 143, + setgid = 144, + setreuid = 145, + setuid = 146, + setresuid = 147, + getresuid = 148, + setresgid = 149, + getresgid = 150, + setfsuid = 151, + setfsgid = 152, + times = 153, + setpgid = 154, + getpgid = 155, + getsid = 156, + setsid = 157, + getgroups = 158, + setgroups = 159, + uname = 160, + sethostname = 161, + setdomainname = 162, + getrlimit = 163, + setrlimit = 164, + getrusage = 165, + umask = 166, + prctl = 167, + getcpu = 168, + gettimeofday = 169, + settimeofday = 170, + adjtimex = 171, + getpid = 172, + getppid = 173, + getuid = 174, + geteuid = 175, + getgid = 176, + getegid = 177, + gettid = 178, + sysinfo = 179, + mq_open = 180, + mq_unlink = 181, + mq_timedsend = 182, + mq_timedreceive = 183, + mq_notify = 184, + mq_getsetattr = 185, + msgget = 186, + msgctl = 187, + msgrcv = 188, + msgsnd = 189, + semget = 190, + semctl = 191, + semtimedop = 192, + semop = 193, + shmget = 194, + shmctl = 195, + shmat = 196, + shmdt = 197, + socket = 198, + socketpair = 199, + bind = 200, + listen = 201, + accept = 202, + connect = 203, + getsockname = 204, + getpeername = 205, + sendto = 206, + recvfrom = 207, + setsockopt = 208, + getsockopt = 209, + shutdown = 210, + sendmsg = 211, + recvmsg = 212, + readahead = 213, + brk = 214, + munmap = 215, + mremap = 216, + add_key = 217, + request_key = 218, + keyctl = 219, + clone = 220, + execve = 221, + mmap = 222, + fadvise64 = 223, + swapon = 224, + swapoff = 225, + mprotect = 226, + msync = 227, + mlock = 228, + munlock = 229, + mlockall = 230, + munlockall = 231, + mincore = 232, + madvise = 233, + remap_file_pages = 234, + mbind = 235, + get_mempolicy = 236, + set_mempolicy = 237, + migrate_pages = 238, + move_pages = 239, + rt_tgsigqueueinfo = 240, + perf_event_open = 241, + accept4 = 242, + recvmmsg = 243, -pub const SYS_arch_specific_syscall = 244; -pub const SYS_riscv_flush_icache = SYS_arch_specific_syscall + 15; + pub const arch_specific_syscall = 244; + riscv_flush_icache = arch_specific_syscall + 15, -pub const SYS_wait4 = 260; -pub const SYS_prlimit64 = 261; -pub const SYS_fanotify_init = 262; -pub const SYS_fanotify_mark = 263; -pub const SYS_name_to_handle_at = 264; -pub const SYS_open_by_handle_at = 265; -pub const SYS_clock_adjtime = 266; -pub const SYS_syncfs = 267; -pub const SYS_setns = 268; -pub const SYS_sendmmsg = 269; -pub const SYS_process_vm_readv = 270; -pub const SYS_process_vm_writev = 271; -pub const SYS_kcmp = 272; -pub const SYS_finit_module = 273; -pub const SYS_sched_setattr = 274; -pub const SYS_sched_getattr = 275; -pub const SYS_renameat2 = 276; -pub const SYS_seccomp = 277; -pub const SYS_getrandom = 278; -pub const SYS_memfd_create = 279; -pub const SYS_bpf = 280; -pub const SYS_execveat = 281; -pub const SYS_userfaultfd = 282; -pub const SYS_membarrier = 283; -pub const SYS_mlock2 = 284; -pub const SYS_copy_file_range = 285; -pub const SYS_preadv2 = 286; -pub const SYS_pwritev2 = 287; -pub const SYS_pkey_mprotect = 288; -pub const SYS_pkey_alloc = 289; -pub const SYS_pkey_free = 290; -pub const SYS_statx = 291; -pub const SYS_io_pgetevents = 292; -pub const SYS_rseq = 293; -pub const SYS_kexec_file_load = 294; -pub const SYS_pidfd_send_signal = 424; -pub const SYS_io_uring_setup = 425; -pub const SYS_io_uring_enter = 426; -pub const SYS_io_uring_register = 427; -pub const SYS_open_tree = 428; -pub const SYS_move_mount = 429; -pub const SYS_fsopen = 430; -pub const SYS_fsconfig = 431; -pub const SYS_fsmount = 432; -pub const SYS_fspick = 433; -pub const SYS_pidfd_open = 434; -pub const SYS_clone3 = 435; -pub const SYS_openat2 = 437; -pub const SYS_pidfd_getfd = 438; + wait4 = 260, + prlimit64 = 261, + fanotify_init = 262, + fanotify_mark = 263, + name_to_handle_at = 264, + open_by_handle_at = 265, + clock_adjtime = 266, + syncfs = 267, + setns = 268, + sendmmsg = 269, + process_vm_readv = 270, + process_vm_writev = 271, + kcmp = 272, + finit_module = 273, + sched_setattr = 274, + sched_getattr = 275, + renameat2 = 276, + seccomp = 277, + getrandom = 278, + memfd_create = 279, + bpf = 280, + execveat = 281, + userfaultfd = 282, + membarrier = 283, + mlock2 = 284, + copy_file_range = 285, + preadv2 = 286, + pwritev2 = 287, + pkey_mprotect = 288, + pkey_alloc = 289, + pkey_free = 290, + statx = 291, + io_pgetevents = 292, + rseq = 293, + kexec_file_load = 294, + pidfd_send_signal = 424, + io_uring_setup = 425, + io_uring_enter = 426, + io_uring_register = 427, + open_tree = 428, + move_mount = 429, + fsopen = 430, + fsconfig = 431, + fsmount = 432, + fspick = 433, + pidfd_open = 434, + clone3 = 435, + openat2 = 437, + pidfd_getfd = 438, + + _, +}; pub const O_CREAT = 0o100; pub const O_EXCL = 0o200; diff --git a/lib/std/os/bits/linux/x86_64.zig b/lib/std/os/bits/linux/x86_64.zig index 96984c7c5a..4fd9922674 100644 --- a/lib/std/os/bits/linux/x86_64.zig +++ b/lib/std/os/bits/linux/x86_64.zig @@ -14,356 +14,360 @@ const iovec_const = linux.iovec_const; pub const mode_t = usize; -pub const SYS_read = 0; -pub const SYS_write = 1; -pub const SYS_open = 2; -pub const SYS_close = 3; -pub const SYS_stat = 4; -pub const SYS_fstat = 5; -pub const SYS_lstat = 6; -pub const SYS_poll = 7; -pub const SYS_lseek = 8; -pub const SYS_mmap = 9; -pub const SYS_mprotect = 10; -pub const SYS_munmap = 11; -pub const SYS_brk = 12; -pub const SYS_rt_sigaction = 13; -pub const SYS_rt_sigprocmask = 14; -pub const SYS_rt_sigreturn = 15; -pub const SYS_ioctl = 16; -pub const SYS_pread = 17; -pub const SYS_pwrite = 18; -pub const SYS_readv = 19; -pub const SYS_writev = 20; -pub const SYS_access = 21; -pub const SYS_pipe = 22; -pub const SYS_select = 23; -pub const SYS_sched_yield = 24; -pub const SYS_mremap = 25; -pub const SYS_msync = 26; -pub const SYS_mincore = 27; -pub const SYS_madvise = 28; -pub const SYS_shmget = 29; -pub const SYS_shmat = 30; -pub const SYS_shmctl = 31; -pub const SYS_dup = 32; -pub const SYS_dup2 = 33; -pub const SYS_pause = 34; -pub const SYS_nanosleep = 35; -pub const SYS_getitimer = 36; -pub const SYS_alarm = 37; -pub const SYS_setitimer = 38; -pub const SYS_getpid = 39; -pub const SYS_sendfile = 40; -pub const SYS_socket = 41; -pub const SYS_connect = 42; -pub const SYS_accept = 43; -pub const SYS_sendto = 44; -pub const SYS_recvfrom = 45; -pub const SYS_sendmsg = 46; -pub const SYS_recvmsg = 47; -pub const SYS_shutdown = 48; -pub const SYS_bind = 49; -pub const SYS_listen = 50; -pub const SYS_getsockname = 51; -pub const SYS_getpeername = 52; -pub const SYS_socketpair = 53; -pub const SYS_setsockopt = 54; -pub const SYS_getsockopt = 55; -pub const SYS_clone = 56; -pub const SYS_fork = 57; -pub const SYS_vfork = 58; -pub const SYS_execve = 59; -pub const SYS_exit = 60; -pub const SYS_wait4 = 61; -pub const SYS_kill = 62; -pub const SYS_uname = 63; -pub const SYS_semget = 64; -pub const SYS_semop = 65; -pub const SYS_semctl = 66; -pub const SYS_shmdt = 67; -pub const SYS_msgget = 68; -pub const SYS_msgsnd = 69; -pub const SYS_msgrcv = 70; -pub const SYS_msgctl = 71; -pub const SYS_fcntl = 72; -pub const SYS_flock = 73; -pub const SYS_fsync = 74; -pub const SYS_fdatasync = 75; -pub const SYS_truncate = 76; -pub const SYS_ftruncate = 77; -pub const SYS_getdents = 78; -pub const SYS_getcwd = 79; -pub const SYS_chdir = 80; -pub const SYS_fchdir = 81; -pub const SYS_rename = 82; -pub const SYS_mkdir = 83; -pub const SYS_rmdir = 84; -pub const SYS_creat = 85; -pub const SYS_link = 86; -pub const SYS_unlink = 87; -pub const SYS_symlink = 88; -pub const SYS_readlink = 89; -pub const SYS_chmod = 90; -pub const SYS_fchmod = 91; -pub const SYS_chown = 92; -pub const SYS_fchown = 93; -pub const SYS_lchown = 94; -pub const SYS_umask = 95; -pub const SYS_gettimeofday = 96; -pub const SYS_getrlimit = 97; -pub const SYS_getrusage = 98; -pub const SYS_sysinfo = 99; -pub const SYS_times = 100; -pub const SYS_ptrace = 101; -pub const SYS_getuid = 102; -pub const SYS_syslog = 103; -pub const SYS_getgid = 104; -pub const SYS_setuid = 105; -pub const SYS_setgid = 106; -pub const SYS_geteuid = 107; -pub const SYS_getegid = 108; -pub const SYS_setpgid = 109; -pub const SYS_getppid = 110; -pub const SYS_getpgrp = 111; -pub const SYS_setsid = 112; -pub const SYS_setreuid = 113; -pub const SYS_setregid = 114; -pub const SYS_getgroups = 115; -pub const SYS_setgroups = 116; -pub const SYS_setresuid = 117; -pub const SYS_getresuid = 118; -pub const SYS_setresgid = 119; -pub const SYS_getresgid = 120; -pub const SYS_getpgid = 121; -pub const SYS_setfsuid = 122; -pub const SYS_setfsgid = 123; -pub const SYS_getsid = 124; -pub const SYS_capget = 125; -pub const SYS_capset = 126; -pub const SYS_rt_sigpending = 127; -pub const SYS_rt_sigtimedwait = 128; -pub const SYS_rt_sigqueueinfo = 129; -pub const SYS_rt_sigsuspend = 130; -pub const SYS_sigaltstack = 131; -pub const SYS_utime = 132; -pub const SYS_mknod = 133; -pub const SYS_uselib = 134; -pub const SYS_personality = 135; -pub const SYS_ustat = 136; -pub const SYS_statfs = 137; -pub const SYS_fstatfs = 138; -pub const SYS_sysfs = 139; -pub const SYS_getpriority = 140; -pub const SYS_setpriority = 141; -pub const SYS_sched_setparam = 142; -pub const SYS_sched_getparam = 143; -pub const SYS_sched_setscheduler = 144; -pub const SYS_sched_getscheduler = 145; -pub const SYS_sched_get_priority_max = 146; -pub const SYS_sched_get_priority_min = 147; -pub const SYS_sched_rr_get_interval = 148; -pub const SYS_mlock = 149; -pub const SYS_munlock = 150; -pub const SYS_mlockall = 151; -pub const SYS_munlockall = 152; -pub const SYS_vhangup = 153; -pub const SYS_modify_ldt = 154; -pub const SYS_pivot_root = 155; -pub const SYS__sysctl = 156; -pub const SYS_prctl = 157; -pub const SYS_arch_prctl = 158; -pub const SYS_adjtimex = 159; -pub const SYS_setrlimit = 160; -pub const SYS_chroot = 161; -pub const SYS_sync = 162; -pub const SYS_acct = 163; -pub const SYS_settimeofday = 164; -pub const SYS_mount = 165; -pub const SYS_umount2 = 166; -pub const SYS_swapon = 167; -pub const SYS_swapoff = 168; -pub const SYS_reboot = 169; -pub const SYS_sethostname = 170; -pub const SYS_setdomainname = 171; -pub const SYS_iopl = 172; -pub const SYS_ioperm = 173; -pub const SYS_create_module = 174; -pub const SYS_init_module = 175; -pub const SYS_delete_module = 176; -pub const SYS_get_kernel_syms = 177; -pub const SYS_query_module = 178; -pub const SYS_quotactl = 179; -pub const SYS_nfsservctl = 180; -pub const SYS_getpmsg = 181; -pub const SYS_putpmsg = 182; -pub const SYS_afs_syscall = 183; -pub const SYS_tuxcall = 184; -pub const SYS_security = 185; -pub const SYS_gettid = 186; -pub const SYS_readahead = 187; -pub const SYS_setxattr = 188; -pub const SYS_lsetxattr = 189; -pub const SYS_fsetxattr = 190; -pub const SYS_getxattr = 191; -pub const SYS_lgetxattr = 192; -pub const SYS_fgetxattr = 193; -pub const SYS_listxattr = 194; -pub const SYS_llistxattr = 195; -pub const SYS_flistxattr = 196; -pub const SYS_removexattr = 197; -pub const SYS_lremovexattr = 198; -pub const SYS_fremovexattr = 199; -pub const SYS_tkill = 200; -pub const SYS_time = 201; -pub const SYS_futex = 202; -pub const SYS_sched_setaffinity = 203; -pub const SYS_sched_getaffinity = 204; -pub const SYS_set_thread_area = 205; -pub const SYS_io_setup = 206; -pub const SYS_io_destroy = 207; -pub const SYS_io_getevents = 208; -pub const SYS_io_submit = 209; -pub const SYS_io_cancel = 210; -pub const SYS_get_thread_area = 211; -pub const SYS_lookup_dcookie = 212; -pub const SYS_epoll_create = 213; -pub const SYS_epoll_ctl_old = 214; -pub const SYS_epoll_wait_old = 215; -pub const SYS_remap_file_pages = 216; -pub const SYS_getdents64 = 217; -pub const SYS_set_tid_address = 218; -pub const SYS_restart_syscall = 219; -pub const SYS_semtimedop = 220; -pub const SYS_fadvise64 = 221; -pub const SYS_timer_create = 222; -pub const SYS_timer_settime = 223; -pub const SYS_timer_gettime = 224; -pub const SYS_timer_getoverrun = 225; -pub const SYS_timer_delete = 226; -pub const SYS_clock_settime = 227; -pub const SYS_clock_gettime = 228; -pub const SYS_clock_getres = 229; -pub const SYS_clock_nanosleep = 230; -pub const SYS_exit_group = 231; -pub const SYS_epoll_wait = 232; -pub const SYS_epoll_ctl = 233; -pub const SYS_tgkill = 234; -pub const SYS_utimes = 235; -pub const SYS_vserver = 236; -pub const SYS_mbind = 237; -pub const SYS_set_mempolicy = 238; -pub const SYS_get_mempolicy = 239; -pub const SYS_mq_open = 240; -pub const SYS_mq_unlink = 241; -pub const SYS_mq_timedsend = 242; -pub const SYS_mq_timedreceive = 243; -pub const SYS_mq_notify = 244; -pub const SYS_mq_getsetattr = 245; -pub const SYS_kexec_load = 246; -pub const SYS_waitid = 247; -pub const SYS_add_key = 248; -pub const SYS_request_key = 249; -pub const SYS_keyctl = 250; -pub const SYS_ioprio_set = 251; -pub const SYS_ioprio_get = 252; -pub const SYS_inotify_init = 253; -pub const SYS_inotify_add_watch = 254; -pub const SYS_inotify_rm_watch = 255; -pub const SYS_migrate_pages = 256; -pub const SYS_openat = 257; -pub const SYS_mkdirat = 258; -pub const SYS_mknodat = 259; -pub const SYS_fchownat = 260; -pub const SYS_futimesat = 261; -pub const SYS_newfstatat = 262; -pub const SYS_fstatat = 262; -pub const SYS_unlinkat = 263; -pub const SYS_renameat = 264; -pub const SYS_linkat = 265; -pub const SYS_symlinkat = 266; -pub const SYS_readlinkat = 267; -pub const SYS_fchmodat = 268; -pub const SYS_faccessat = 269; -pub const SYS_pselect6 = 270; -pub const SYS_ppoll = 271; -pub const SYS_unshare = 272; -pub const SYS_set_robust_list = 273; -pub const SYS_get_robust_list = 274; -pub const SYS_splice = 275; -pub const SYS_tee = 276; -pub const SYS_sync_file_range = 277; -pub const SYS_vmsplice = 278; -pub const SYS_move_pages = 279; -pub const SYS_utimensat = 280; -pub const SYS_epoll_pwait = 281; -pub const SYS_signalfd = 282; -pub const SYS_timerfd_create = 283; -pub const SYS_eventfd = 284; -pub const SYS_fallocate = 285; -pub const SYS_timerfd_settime = 286; -pub const SYS_timerfd_gettime = 287; -pub const SYS_accept4 = 288; -pub const SYS_signalfd4 = 289; -pub const SYS_eventfd2 = 290; -pub const SYS_epoll_create1 = 291; -pub const SYS_dup3 = 292; -pub const SYS_pipe2 = 293; -pub const SYS_inotify_init1 = 294; -pub const SYS_preadv = 295; -pub const SYS_pwritev = 296; -pub const SYS_rt_tgsigqueueinfo = 297; -pub const SYS_perf_event_open = 298; -pub const SYS_recvmmsg = 299; -pub const SYS_fanotify_init = 300; -pub const SYS_fanotify_mark = 301; -pub const SYS_prlimit64 = 302; -pub const SYS_name_to_handle_at = 303; -pub const SYS_open_by_handle_at = 304; -pub const SYS_clock_adjtime = 305; -pub const SYS_syncfs = 306; -pub const SYS_sendmmsg = 307; -pub const SYS_setns = 308; -pub const SYS_getcpu = 309; -pub const SYS_process_vm_readv = 310; -pub const SYS_process_vm_writev = 311; -pub const SYS_kcmp = 312; -pub const SYS_finit_module = 313; -pub const SYS_sched_setattr = 314; -pub const SYS_sched_getattr = 315; -pub const SYS_renameat2 = 316; -pub const SYS_seccomp = 317; -pub const SYS_getrandom = 318; -pub const SYS_memfd_create = 319; -pub const SYS_kexec_file_load = 320; -pub const SYS_bpf = 321; -pub const SYS_execveat = 322; -pub const SYS_userfaultfd = 323; -pub const SYS_membarrier = 324; -pub const SYS_mlock2 = 325; -pub const SYS_copy_file_range = 326; -pub const SYS_preadv2 = 327; -pub const SYS_pwritev2 = 328; -pub const SYS_pkey_mprotect = 329; -pub const SYS_pkey_alloc = 330; -pub const SYS_pkey_free = 331; -pub const SYS_statx = 332; -pub const SYS_io_pgetevents = 333; -pub const SYS_rseq = 334; -pub const SYS_pidfd_send_signal = 424; -pub const SYS_io_uring_setup = 425; -pub const SYS_io_uring_enter = 426; -pub const SYS_io_uring_register = 427; -pub const SYS_open_tree = 428; -pub const SYS_move_mount = 429; -pub const SYS_fsopen = 430; -pub const SYS_fsconfig = 431; -pub const SYS_fsmount = 432; -pub const SYS_fspick = 433; -pub const SYS_pidfd_open = 434; -pub const SYS_clone3 = 435; -pub const SYS_openat2 = 437; -pub const SYS_pidfd_getfd = 438; +pub const SYS = extern enum(usize) { + read = 0, + write = 1, + open = 2, + close = 3, + stat = 4, + fstat = 5, + lstat = 6, + poll = 7, + lseek = 8, + mmap = 9, + mprotect = 10, + munmap = 11, + brk = 12, + rt_sigaction = 13, + rt_sigprocmask = 14, + rt_sigreturn = 15, + ioctl = 16, + pread = 17, + pwrite = 18, + readv = 19, + writev = 20, + access = 21, + pipe = 22, + select = 23, + sched_yield = 24, + mremap = 25, + msync = 26, + mincore = 27, + madvise = 28, + shmget = 29, + shmat = 30, + shmctl = 31, + dup = 32, + dup2 = 33, + pause = 34, + nanosleep = 35, + getitimer = 36, + alarm = 37, + setitimer = 38, + getpid = 39, + sendfile = 40, + socket = 41, + connect = 42, + accept = 43, + sendto = 44, + recvfrom = 45, + sendmsg = 46, + recvmsg = 47, + shutdown = 48, + bind = 49, + listen = 50, + getsockname = 51, + getpeername = 52, + socketpair = 53, + setsockopt = 54, + getsockopt = 55, + clone = 56, + fork = 57, + vfork = 58, + execve = 59, + exit = 60, + wait4 = 61, + kill = 62, + uname = 63, + semget = 64, + semop = 65, + semctl = 66, + shmdt = 67, + msgget = 68, + msgsnd = 69, + msgrcv = 70, + msgctl = 71, + fcntl = 72, + flock = 73, + fsync = 74, + fdatasync = 75, + truncate = 76, + ftruncate = 77, + getdents = 78, + getcwd = 79, + chdir = 80, + fchdir = 81, + rename = 82, + mkdir = 83, + rmdir = 84, + creat = 85, + link = 86, + unlink = 87, + symlink = 88, + readlink = 89, + chmod = 90, + fchmod = 91, + chown = 92, + fchown = 93, + lchown = 94, + umask = 95, + gettimeofday = 96, + getrlimit = 97, + getrusage = 98, + sysinfo = 99, + times = 100, + ptrace = 101, + getuid = 102, + syslog = 103, + getgid = 104, + setuid = 105, + setgid = 106, + geteuid = 107, + getegid = 108, + setpgid = 109, + getppid = 110, + getpgrp = 111, + setsid = 112, + setreuid = 113, + setregid = 114, + getgroups = 115, + setgroups = 116, + setresuid = 117, + getresuid = 118, + setresgid = 119, + getresgid = 120, + getpgid = 121, + setfsuid = 122, + setfsgid = 123, + getsid = 124, + capget = 125, + capset = 126, + rt_sigpending = 127, + rt_sigtimedwait = 128, + rt_sigqueueinfo = 129, + rt_sigsuspend = 130, + sigaltstack = 131, + utime = 132, + mknod = 133, + uselib = 134, + personality = 135, + ustat = 136, + statfs = 137, + fstatfs = 138, + sysfs = 139, + getpriority = 140, + setpriority = 141, + sched_setparam = 142, + sched_getparam = 143, + sched_setscheduler = 144, + sched_getscheduler = 145, + sched_get_priority_max = 146, + sched_get_priority_min = 147, + sched_rr_get_interval = 148, + mlock = 149, + munlock = 150, + mlockall = 151, + munlockall = 152, + vhangup = 153, + modify_ldt = 154, + pivot_root = 155, + _sysctl = 156, + prctl = 157, + arch_prctl = 158, + adjtimex = 159, + setrlimit = 160, + chroot = 161, + sync = 162, + acct = 163, + settimeofday = 164, + mount = 165, + umount2 = 166, + swapon = 167, + swapoff = 168, + reboot = 169, + sethostname = 170, + setdomainname = 171, + iopl = 172, + ioperm = 173, + create_module = 174, + init_module = 175, + delete_module = 176, + get_kernel_syms = 177, + query_module = 178, + quotactl = 179, + nfsservctl = 180, + getpmsg = 181, + putpmsg = 182, + afs_syscall = 183, + tuxcall = 184, + security = 185, + gettid = 186, + readahead = 187, + setxattr = 188, + lsetxattr = 189, + fsetxattr = 190, + getxattr = 191, + lgetxattr = 192, + fgetxattr = 193, + listxattr = 194, + llistxattr = 195, + flistxattr = 196, + removexattr = 197, + lremovexattr = 198, + fremovexattr = 199, + tkill = 200, + time = 201, + futex = 202, + sched_setaffinity = 203, + sched_getaffinity = 204, + set_thread_area = 205, + io_setup = 206, + io_destroy = 207, + io_getevents = 208, + io_submit = 209, + io_cancel = 210, + get_thread_area = 211, + lookup_dcookie = 212, + epoll_create = 213, + epoll_ctl_old = 214, + epoll_wait_old = 215, + remap_file_pages = 216, + getdents64 = 217, + set_tid_address = 218, + restart_syscall = 219, + semtimedop = 220, + fadvise64 = 221, + timer_create = 222, + timer_settime = 223, + timer_gettime = 224, + timer_getoverrun = 225, + timer_delete = 226, + clock_settime = 227, + clock_gettime = 228, + clock_getres = 229, + clock_nanosleep = 230, + exit_group = 231, + epoll_wait = 232, + epoll_ctl = 233, + tgkill = 234, + utimes = 235, + vserver = 236, + mbind = 237, + set_mempolicy = 238, + get_mempolicy = 239, + mq_open = 240, + mq_unlink = 241, + mq_timedsend = 242, + mq_timedreceive = 243, + mq_notify = 244, + mq_getsetattr = 245, + kexec_load = 246, + waitid = 247, + add_key = 248, + request_key = 249, + keyctl = 250, + ioprio_set = 251, + ioprio_get = 252, + inotify_init = 253, + inotify_add_watch = 254, + inotify_rm_watch = 255, + migrate_pages = 256, + openat = 257, + mkdirat = 258, + mknodat = 259, + fchownat = 260, + futimesat = 261, + newfstatat = 262, + fstatat = 262, + unlinkat = 263, + renameat = 264, + linkat = 265, + symlinkat = 266, + readlinkat = 267, + fchmodat = 268, + faccessat = 269, + pselect6 = 270, + ppoll = 271, + unshare = 272, + set_robust_list = 273, + get_robust_list = 274, + splice = 275, + tee = 276, + sync_file_range = 277, + vmsplice = 278, + move_pages = 279, + utimensat = 280, + epoll_pwait = 281, + signalfd = 282, + timerfd_create = 283, + eventfd = 284, + fallocate = 285, + timerfd_settime = 286, + timerfd_gettime = 287, + accept4 = 288, + signalfd4 = 289, + eventfd2 = 290, + epoll_create1 = 291, + dup3 = 292, + pipe2 = 293, + inotify_init1 = 294, + preadv = 295, + pwritev = 296, + rt_tgsigqueueinfo = 297, + perf_event_open = 298, + recvmmsg = 299, + fanotify_init = 300, + fanotify_mark = 301, + prlimit64 = 302, + name_to_handle_at = 303, + open_by_handle_at = 304, + clock_adjtime = 305, + syncfs = 306, + sendmmsg = 307, + setns = 308, + getcpu = 309, + process_vm_readv = 310, + process_vm_writev = 311, + kcmp = 312, + finit_module = 313, + sched_setattr = 314, + sched_getattr = 315, + renameat2 = 316, + seccomp = 317, + getrandom = 318, + memfd_create = 319, + kexec_file_load = 320, + bpf = 321, + execveat = 322, + userfaultfd = 323, + membarrier = 324, + mlock2 = 325, + copy_file_range = 326, + preadv2 = 327, + pwritev2 = 328, + pkey_mprotect = 329, + pkey_alloc = 330, + pkey_free = 331, + statx = 332, + io_pgetevents = 333, + rseq = 334, + pidfd_send_signal = 424, + io_uring_setup = 425, + io_uring_enter = 426, + io_uring_register = 427, + open_tree = 428, + move_mount = 429, + fsopen = 430, + fsconfig = 431, + fsmount = 432, + fspick = 433, + pidfd_open = 434, + clone3 = 435, + openat2 = 437, + pidfd_getfd = 438, + + _, +}; pub const O_CREAT = 0o100; pub const O_EXCL = 0o200; diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 2e1437e6a9..1ed8370274 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -53,46 +53,46 @@ pub fn getErrno(r: usize) u12 { } pub fn dup2(old: i32, new: i32) usize { - if (@hasDecl(@This(), "SYS_dup2")) { - return syscall2(SYS_dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new))); + if (@hasField(SYS, "dup2")) { + return syscall2(.dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new))); } else { if (old == new) { if (std.debug.runtime_safety) { - const rc = syscall2(SYS_fcntl, @bitCast(usize, @as(isize, old)), F_GETFD); + const rc = syscall2(.fcntl, @bitCast(usize, @as(isize, old)), F_GETFD); if (@bitCast(isize, rc) < 0) return rc; } return @intCast(usize, old); } else { - return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), 0); + return syscall3(.dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), 0); } } } pub fn dup3(old: i32, new: i32, flags: u32) usize { - return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags); + return syscall3(.dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags); } pub fn chdir(path: [*:0]const u8) usize { - return syscall1(SYS_chdir, @ptrToInt(path)); + return syscall1(.chdir, @ptrToInt(path)); } pub fn fchdir(fd: fd_t) usize { - return syscall1(SYS_fchdir, @bitCast(usize, @as(isize, fd))); + return syscall1(.fchdir, @bitCast(usize, @as(isize, fd))); } pub fn chroot(path: [*:0]const u8) usize { - return syscall1(SYS_chroot, @ptrToInt(path)); + return syscall1(.chroot, @ptrToInt(path)); } pub fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) usize { - return syscall3(SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp)); + return syscall3(.execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp)); } pub fn fork() usize { - if (@hasDecl(@This(), "SYS_fork")) { - return syscall0(SYS_fork); + if (@hasField(SYS, "fork")) { + return syscall0(.fork); } else { - return syscall2(SYS_clone, SIGCHLD, 0); + return syscall2(.clone, SIGCHLD, 0); } } @@ -102,7 +102,7 @@ pub fn fork() usize { /// the compiler is not aware of how vfork affects control flow and you may /// see different results in optimized builds. pub inline fn vfork() usize { - return @call(.{ .modifier = .always_inline }, syscall0, .{SYS_vfork}); + return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork}); } pub fn futimens(fd: i32, times: *const [2]timespec) usize { @@ -110,24 +110,24 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize { } pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, flags: u32) usize { - return syscall4(SYS_utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); + return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); } pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize { - return syscall4(SYS_futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout)); + return syscall4(.futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout)); } pub fn futex_wake(uaddr: *const i32, futex_op: u32, val: i32) usize { - return syscall3(SYS_futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val)); + return syscall3(.futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val)); } pub fn getcwd(buf: [*]u8, size: usize) usize { - return syscall2(SYS_getcwd, @ptrToInt(buf), size); + return syscall2(.getcwd, @ptrToInt(buf), size); } pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize { return syscall3( - SYS_getdents, + .getdents, @bitCast(usize, @as(isize, fd)), @ptrToInt(dirp), std.math.min(len, maxInt(c_int)), @@ -136,7 +136,7 @@ pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize { pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize { return syscall3( - SYS_getdents64, + .getdents64, @bitCast(usize, @as(isize, fd)), @ptrToInt(dirp), std.math.min(len, maxInt(c_int)), @@ -144,61 +144,61 @@ pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize { } pub fn inotify_init1(flags: u32) usize { - return syscall1(SYS_inotify_init1, flags); + return syscall1(.inotify_init1, flags); } pub fn inotify_add_watch(fd: i32, pathname: [*:0]const u8, mask: u32) usize { - return syscall3(SYS_inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask); + return syscall3(.inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask); } pub fn inotify_rm_watch(fd: i32, wd: i32) usize { - return syscall2(SYS_inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd))); + return syscall2(.inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd))); } pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { - if (@hasDecl(@This(), "SYS_readlink")) { - return syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); + if (@hasField(SYS, "readlink")) { + return syscall3(.readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); } else { - return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); + return syscall4(.readlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); } } pub fn readlinkat(dirfd: i32, noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { - return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); + return syscall4(.readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); } pub fn mkdir(path: [*:0]const u8, mode: u32) usize { - if (@hasDecl(@This(), "SYS_mkdir")) { - return syscall2(SYS_mkdir, @ptrToInt(path), mode); + if (@hasField(SYS, "mkdir")) { + return syscall2(.mkdir, @ptrToInt(path), mode); } else { - return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode); + return syscall3(.mkdirat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode); } } pub fn mkdirat(dirfd: i32, path: [*:0]const u8, mode: u32) usize { - return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode); + return syscall3(.mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode); } pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize { - return syscall5(SYS_mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data); + return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data); } pub fn umount(special: [*:0]const u8) usize { - return syscall2(SYS_umount2, @ptrToInt(special), 0); + return syscall2(.umount2, @ptrToInt(special), 0); } pub fn umount2(special: [*:0]const u8, flags: u32) usize { - return syscall2(SYS_umount2, @ptrToInt(special), flags); + return syscall2(.umount2, @ptrToInt(special), flags); } pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: u64) usize { - if (@hasDecl(@This(), "SYS_mmap2")) { + if (@hasField(SYS, "mmap2")) { // Make sure the offset is also specified in multiples of page size if ((offset & (MMAP2_UNIT - 1)) != 0) return @bitCast(usize, @as(isize, -EINVAL)); return syscall6( - SYS_mmap2, + .mmap2, @ptrToInt(address), length, prot, @@ -208,7 +208,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of ); } else { return syscall6( - SYS_mmap, + .mmap, @ptrToInt(address), length, prot, @@ -220,19 +220,19 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of } pub fn mprotect(address: [*]const u8, length: usize, protection: usize) usize { - return syscall3(SYS_mprotect, @ptrToInt(address), length, protection); + return syscall3(.mprotect, @ptrToInt(address), length, protection); } pub fn munmap(address: [*]const u8, length: usize) usize { - return syscall2(SYS_munmap, @ptrToInt(address), length); + return syscall2(.munmap, @ptrToInt(address), length); } pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize { - if (@hasDecl(@This(), "SYS_poll")) { - return syscall3(SYS_poll, @ptrToInt(fds), n, @bitCast(u32, timeout)); + if (@hasField(SYS, "poll")) { + return syscall3(.poll, @ptrToInt(fds), n, @bitCast(u32, timeout)); } else { return syscall6( - SYS_ppoll, + .ppoll, @ptrToInt(fds), n, @ptrToInt(if (timeout >= 0) @@ -250,12 +250,12 @@ pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize { } pub fn read(fd: i32, buf: [*]u8, count: usize) usize { - return syscall3(SYS_read, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count); + return syscall3(.read, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count); } pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize { return syscall5( - SYS_preadv, + .preadv, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count, @@ -266,7 +266,7 @@ pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize { pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: kernel_rwf) usize { return syscall6( - SYS_preadv2, + .preadv2, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count, @@ -277,16 +277,16 @@ pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: k } pub fn readv(fd: i32, iov: [*]const iovec, count: usize) usize { - return syscall3(SYS_readv, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count); + return syscall3(.readv, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count); } pub fn writev(fd: i32, iov: [*]const iovec_const, count: usize) usize { - return syscall3(SYS_writev, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count); + return syscall3(.writev, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count); } pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) usize { return syscall5( - SYS_pwritev, + .pwritev, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count, @@ -297,7 +297,7 @@ pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) us pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, flags: kernel_rwf) usize { return syscall6( - SYS_pwritev2, + .pwritev2, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count, @@ -308,30 +308,30 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f } pub fn rmdir(path: [*:0]const u8) usize { - if (@hasDecl(@This(), "SYS_rmdir")) { - return syscall1(SYS_rmdir, @ptrToInt(path)); + if (@hasField(SYS, "rmdir")) { + return syscall1(.rmdir, @ptrToInt(path)); } else { - return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), AT_REMOVEDIR); + return syscall3(.unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), AT_REMOVEDIR); } } pub fn symlink(existing: [*:0]const u8, new: [*:0]const u8) usize { - if (@hasDecl(@This(), "SYS_symlink")) { - return syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new)); + if (@hasField(SYS, "symlink")) { + return syscall2(.symlink, @ptrToInt(existing), @ptrToInt(new)); } else { - return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new)); + return syscall3(.symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new)); } } pub fn symlinkat(existing: [*:0]const u8, newfd: i32, newpath: [*:0]const u8) usize { - return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath)); + return syscall3(.symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath)); } pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize { - if (@hasDecl(@This(), "SYS_pread64")) { + if (@hasField(SYS, "pread64")) { if (require_aligned_register_pair) { return syscall6( - SYS_pread64, + .pread64, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -341,7 +341,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize { ); } else { return syscall5( - SYS_pread64, + .pread64, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -351,7 +351,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize { } } else { return syscall4( - SYS_pread, + .pread, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -361,40 +361,40 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize { } pub fn access(path: [*:0]const u8, mode: u32) usize { - if (@hasDecl(@This(), "SYS_access")) { - return syscall2(SYS_access, @ptrToInt(path), mode); + if (@hasField(SYS, "access")) { + return syscall2(.access, @ptrToInt(path), mode); } else { - return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode, 0); + return syscall4(.faccessat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode, 0); } } pub fn faccessat(dirfd: i32, path: [*:0]const u8, mode: u32, flags: u32) usize { - return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags); + return syscall4(.faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags); } pub fn pipe(fd: *[2]i32) usize { if (comptime builtin.arch.isMIPS()) { return syscall_pipe(fd); - } else if (@hasDecl(@This(), "SYS_pipe")) { - return syscall1(SYS_pipe, @ptrToInt(fd)); + } else if (@hasField(SYS, "pipe")) { + return syscall1(.pipe, @ptrToInt(fd)); } else { - return syscall2(SYS_pipe2, @ptrToInt(fd), 0); + return syscall2(.pipe2, @ptrToInt(fd), 0); } } pub fn pipe2(fd: *[2]i32, flags: u32) usize { - return syscall2(SYS_pipe2, @ptrToInt(fd), flags); + return syscall2(.pipe2, @ptrToInt(fd), flags); } pub fn write(fd: i32, buf: [*]const u8, count: usize) usize { - return syscall3(SYS_write, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count); + return syscall3(.write, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count); } pub fn ftruncate(fd: i32, length: u64) usize { - if (@hasDecl(@This(), "SYS_ftruncate64")) { + if (@hasField(SYS, "ftruncate64")) { if (require_aligned_register_pair) { return syscall4( - SYS_ftruncate64, + .ftruncate64, @bitCast(usize, @as(isize, fd)), 0, @truncate(usize, length), @@ -402,7 +402,7 @@ pub fn ftruncate(fd: i32, length: u64) usize { ); } else { return syscall3( - SYS_ftruncate64, + .ftruncate64, @bitCast(usize, @as(isize, fd)), @truncate(usize, length), @truncate(usize, length >> 32), @@ -410,7 +410,7 @@ pub fn ftruncate(fd: i32, length: u64) usize { } } else { return syscall2( - SYS_ftruncate, + .ftruncate, @bitCast(usize, @as(isize, fd)), @truncate(usize, length), ); @@ -418,10 +418,10 @@ pub fn ftruncate(fd: i32, length: u64) usize { } pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { - if (@hasDecl(@This(), "SYS_pwrite64")) { + if (@hasField(SYS, "pwrite64")) { if (require_aligned_register_pair) { return syscall6( - SYS_pwrite64, + .pwrite64, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -431,7 +431,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { ); } else { return syscall5( - SYS_pwrite64, + .pwrite64, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -441,7 +441,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { } } else { return syscall4( - SYS_pwrite, + .pwrite, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, @@ -451,19 +451,19 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { } pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize { - if (@hasDecl(@This(), "SYS_rename")) { - return syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new)); - } else if (@hasDecl(@This(), "SYS_renameat")) { - return syscall4(SYS_renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new)); + if (@hasField(SYS, "rename")) { + return syscall2(.rename, @ptrToInt(old), @ptrToInt(new)); + } else if (@hasField(SYS, "renameat")) { + return syscall4(.renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new)); } else { - return syscall5(SYS_renameat2, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new), 0); + return syscall5(.renameat2, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new), 0); } } pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8) usize { - if (@hasDecl(@This(), "SYS_renameat")) { + if (@hasField(SYS, "renameat")) { return syscall4( - SYS_renameat, + .renameat, @bitCast(usize, @as(isize, oldfd)), @ptrToInt(oldpath), @bitCast(usize, @as(isize, newfd)), @@ -471,7 +471,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const ); } else { return syscall5( - SYS_renameat2, + .renameat2, @bitCast(usize, @as(isize, oldfd)), @ptrToInt(oldpath), @bitCast(usize, @as(isize, newfd)), @@ -483,7 +483,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8, flags: u32) usize { return syscall5( - SYS_renameat2, + .renameat2, @bitCast(usize, @as(isize, oldfd)), @ptrToInt(oldpath), @bitCast(usize, @as(isize, newfd)), @@ -493,11 +493,11 @@ pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]c } pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize { - if (@hasDecl(@This(), "SYS_open")) { - return syscall3(SYS_open, @ptrToInt(path), flags, perm); + if (@hasField(SYS, "open")) { + return syscall3(.open, @ptrToInt(path), flags, perm); } else { return syscall4( - SYS_openat, + .openat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), flags, @@ -507,32 +507,32 @@ pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize { } pub fn create(path: [*:0]const u8, perm: usize) usize { - return syscall2(SYS_creat, @ptrToInt(path), perm); + return syscall2(.creat, @ptrToInt(path), perm); } pub fn openat(dirfd: i32, path: [*:0]const u8, flags: u32, mode: usize) usize { // dirfd could be negative, for example AT_FDCWD is -100 - return syscall4(SYS_openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode); + return syscall4(.openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode); } /// See also `clone` (from the arch-specific include) pub fn clone5(flags: usize, child_stack_ptr: usize, parent_tid: *i32, child_tid: *i32, newtls: usize) usize { - return syscall5(SYS_clone, flags, child_stack_ptr, @ptrToInt(parent_tid), @ptrToInt(child_tid), newtls); + return syscall5(.clone, flags, child_stack_ptr, @ptrToInt(parent_tid), @ptrToInt(child_tid), newtls); } /// See also `clone` (from the arch-specific include) pub fn clone2(flags: u32, child_stack_ptr: usize) usize { - return syscall2(SYS_clone, flags, child_stack_ptr); + return syscall2(.clone, flags, child_stack_ptr); } pub fn close(fd: i32) usize { - return syscall1(SYS_close, @bitCast(usize, @as(isize, fd))); + return syscall1(.close, @bitCast(usize, @as(isize, fd))); } /// Can only be called on 32 bit systems. For 64 bit see `lseek`. pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize { return syscall5( - SYS__llseek, + ._llseek, @bitCast(usize, @as(isize, fd)), @truncate(usize, offset >> 32), @truncate(usize, offset), @@ -543,53 +543,53 @@ pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize { /// Can only be called on 64 bit systems. For 32 bit see `llseek`. pub fn lseek(fd: i32, offset: i64, whence: usize) usize { - return syscall3(SYS_lseek, @bitCast(usize, @as(isize, fd)), @bitCast(usize, offset), whence); + return syscall3(.lseek, @bitCast(usize, @as(isize, fd)), @bitCast(usize, offset), whence); } pub fn exit(status: i32) noreturn { - _ = syscall1(SYS_exit, @bitCast(usize, @as(isize, status))); + _ = syscall1(.exit, @bitCast(usize, @as(isize, status))); unreachable; } pub fn exit_group(status: i32) noreturn { - _ = syscall1(SYS_exit_group, @bitCast(usize, @as(isize, status))); + _ = syscall1(.exit_group, @bitCast(usize, @as(isize, status))); unreachable; } pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize { - return syscall3(SYS_getrandom, @ptrToInt(buf), count, flags); + return syscall3(.getrandom, @ptrToInt(buf), count, flags); } pub fn kill(pid: pid_t, sig: i32) usize { - return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig))); + return syscall2(.kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig))); } pub fn tkill(tid: pid_t, sig: i32) usize { - return syscall2(SYS_tkill, @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig))); + return syscall2(.tkill, @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig))); } pub fn tgkill(tgid: pid_t, tid: pid_t, sig: i32) usize { - return syscall2(SYS_tgkill, @bitCast(usize, @as(isize, tgid)), @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig))); + return syscall2(.tgkill, @bitCast(usize, @as(isize, tgid)), @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig))); } pub fn unlink(path: [*:0]const u8) usize { - if (@hasDecl(@This(), "SYS_unlink")) { - return syscall1(SYS_unlink, @ptrToInt(path)); + if (@hasField(SYS, "unlink")) { + return syscall1(.unlink, @ptrToInt(path)); } else { - return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), 0); + return syscall3(.unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), 0); } } pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize { - return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags); + return syscall3(.unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags); } pub fn waitpid(pid: pid_t, status: *u32, flags: u32) usize { - return syscall4(SYS_wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0); + return syscall4(.wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0); } pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize { - return syscall3(SYS_fcntl, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, cmd)), arg); + return syscall3(.fcntl, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, cmd)), arg); } var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime); @@ -609,7 +609,7 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { } } } - return syscall2(SYS_clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); + return syscall2(.clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); } fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize { @@ -626,86 +626,86 @@ fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize { } pub fn clock_getres(clk_id: i32, tp: *timespec) usize { - return syscall2(SYS_clock_getres, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); + return syscall2(.clock_getres, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); } pub fn clock_settime(clk_id: i32, tp: *const timespec) usize { - return syscall2(SYS_clock_settime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); + return syscall2(.clock_settime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); } pub fn gettimeofday(tv: *timeval, tz: *timezone) usize { - return syscall2(SYS_gettimeofday, @ptrToInt(tv), @ptrToInt(tz)); + return syscall2(.gettimeofday, @ptrToInt(tv), @ptrToInt(tz)); } pub fn settimeofday(tv: *const timeval, tz: *const timezone) usize { - return syscall2(SYS_settimeofday, @ptrToInt(tv), @ptrToInt(tz)); + return syscall2(.settimeofday, @ptrToInt(tv), @ptrToInt(tz)); } pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize { - return syscall2(SYS_nanosleep, @ptrToInt(req), @ptrToInt(rem)); + return syscall2(.nanosleep, @ptrToInt(req), @ptrToInt(rem)); } pub fn setuid(uid: u32) usize { - if (@hasDecl(@This(), "SYS_setuid32")) { - return syscall1(SYS_setuid32, uid); + if (@hasField(SYS, "setuid32")) { + return syscall1(.setuid32, uid); } else { - return syscall1(SYS_setuid, uid); + return syscall1(.setuid, uid); } } pub fn setgid(gid: u32) usize { - if (@hasDecl(@This(), "SYS_setgid32")) { - return syscall1(SYS_setgid32, gid); + if (@hasField(SYS, "setgid32")) { + return syscall1(.setgid32, gid); } else { - return syscall1(SYS_setgid, gid); + return syscall1(.setgid, gid); } } pub fn setreuid(ruid: u32, euid: u32) usize { - if (@hasDecl(@This(), "SYS_setreuid32")) { - return syscall2(SYS_setreuid32, ruid, euid); + if (@hasField(SYS, "setreuid32")) { + return syscall2(.setreuid32, ruid, euid); } else { - return syscall2(SYS_setreuid, ruid, euid); + return syscall2(.setreuid, ruid, euid); } } pub fn setregid(rgid: u32, egid: u32) usize { - if (@hasDecl(@This(), "SYS_setregid32")) { - return syscall2(SYS_setregid32, rgid, egid); + if (@hasField(SYS, "setregid32")) { + return syscall2(.setregid32, rgid, egid); } else { - return syscall2(SYS_setregid, rgid, egid); + return syscall2(.setregid, rgid, egid); } } pub fn getuid() u32 { - if (@hasDecl(@This(), "SYS_getuid32")) { - return @as(u32, syscall0(SYS_getuid32)); + if (@hasField(SYS, "getuid32")) { + return @as(u32, syscall0(.getuid32)); } else { - return @as(u32, syscall0(SYS_getuid)); + return @as(u32, syscall0(.getuid)); } } pub fn getgid() u32 { - if (@hasDecl(@This(), "SYS_getgid32")) { - return @as(u32, syscall0(SYS_getgid32)); + if (@hasField(SYS, "getgid32")) { + return @as(u32, syscall0(.getgid32)); } else { - return @as(u32, syscall0(SYS_getgid)); + return @as(u32, syscall0(.getgid)); } } pub fn geteuid() u32 { - if (@hasDecl(@This(), "SYS_geteuid32")) { - return @as(u32, syscall0(SYS_geteuid32)); + if (@hasField(SYS, "geteuid32")) { + return @as(u32, syscall0(.geteuid32)); } else { - return @as(u32, syscall0(SYS_geteuid)); + return @as(u32, syscall0(.geteuid)); } } pub fn getegid() u32 { - if (@hasDecl(@This(), "SYS_getegid32")) { - return @as(u32, syscall0(SYS_getegid32)); + if (@hasField(SYS, "getegid32")) { + return @as(u32, syscall0(.getegid32)); } else { - return @as(u32, syscall0(SYS_getegid)); + return @as(u32, syscall0(.getegid)); } } @@ -718,63 +718,63 @@ pub fn setegid(egid: u32) usize { } pub fn getresuid(ruid: *u32, euid: *u32, suid: *u32) usize { - if (@hasDecl(@This(), "SYS_getresuid32")) { - return syscall3(SYS_getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid)); + if (@hasField(SYS, "getresuid32")) { + return syscall3(.getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid)); } else { - return syscall3(SYS_getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid)); + return syscall3(.getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid)); } } pub fn getresgid(rgid: *u32, egid: *u32, sgid: *u32) usize { - if (@hasDecl(@This(), "SYS_getresgid32")) { - return syscall3(SYS_getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid)); + if (@hasField(SYS, "getresgid32")) { + return syscall3(.getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid)); } else { - return syscall3(SYS_getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid)); + return syscall3(.getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid)); } } pub fn setresuid(ruid: u32, euid: u32, suid: u32) usize { - if (@hasDecl(@This(), "SYS_setresuid32")) { - return syscall3(SYS_setresuid32, ruid, euid, suid); + if (@hasField(SYS, "setresuid32")) { + return syscall3(.setresuid32, ruid, euid, suid); } else { - return syscall3(SYS_setresuid, ruid, euid, suid); + return syscall3(.setresuid, ruid, euid, suid); } } pub fn setresgid(rgid: u32, egid: u32, sgid: u32) usize { - if (@hasDecl(@This(), "SYS_setresgid32")) { - return syscall3(SYS_setresgid32, rgid, egid, sgid); + if (@hasField(SYS, "setresgid32")) { + return syscall3(.setresgid32, rgid, egid, sgid); } else { - return syscall3(SYS_setresgid, rgid, egid, sgid); + return syscall3(.setresgid, rgid, egid, sgid); } } pub fn getgroups(size: usize, list: *u32) usize { - if (@hasDecl(@This(), "SYS_getgroups32")) { - return syscall2(SYS_getgroups32, size, @ptrToInt(list)); + if (@hasField(SYS, "getgroups32")) { + return syscall2(.getgroups32, size, @ptrToInt(list)); } else { - return syscall2(SYS_getgroups, size, @ptrToInt(list)); + return syscall2(.getgroups, size, @ptrToInt(list)); } } pub fn setgroups(size: usize, list: *const u32) usize { - if (@hasDecl(@This(), "SYS_setgroups32")) { - return syscall2(SYS_setgroups32, size, @ptrToInt(list)); + if (@hasField(SYS, "setgroups32")) { + return syscall2(.setgroups32, size, @ptrToInt(list)); } else { - return syscall2(SYS_setgroups, size, @ptrToInt(list)); + return syscall2(.setgroups, size, @ptrToInt(list)); } } pub fn getpid() pid_t { - return @bitCast(pid_t, @truncate(u32, syscall0(SYS_getpid))); + return @bitCast(pid_t, @truncate(u32, syscall0(.getpid))); } pub fn gettid() pid_t { - return @bitCast(pid_t, @truncate(u32, syscall0(SYS_gettid))); + return @bitCast(pid_t, @truncate(u32, syscall0(.gettid))); } pub fn sigprocmask(flags: u32, noalias set: ?*const sigset_t, noalias oldset: ?*sigset_t) usize { - return syscall4(SYS_rt_sigprocmask, flags, @ptrToInt(set), @ptrToInt(oldset), NSIG / 8); + return syscall4(.rt_sigprocmask, flags, @ptrToInt(set), @ptrToInt(oldset), NSIG / 8); } pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigaction) usize { @@ -792,7 +792,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti var ksa_old: k_sigaction = undefined; const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask)); @memcpy(@ptrCast([*]u8, &ksa.mask), @ptrCast([*]const u8, &act.mask), ksa_mask_size); - const result = syscall4(SYS_rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size); + const result = syscall4(.rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size); const err = getErrno(result); if (err != 0) { return result; @@ -819,42 +819,42 @@ pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) us if (builtin.arch == .i386) { return socketcall(SC_getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) }); } - return syscall3(SYS_getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len)); + return syscall3(.getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len)); } pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) }); } - return syscall3(SYS_getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len)); + return syscall3(.getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len)); } pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize { if (builtin.arch == .i386) { return socketcall(SC_socket, &[3]usize{ domain, socket_type, protocol }); } - return syscall3(SYS_socket, domain, socket_type, protocol); + return syscall3(.socket, domain, socket_type, protocol); } pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) }); } - return syscall5(SYS_setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen)); + return syscall5(.setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen)); } pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) }); } - return syscall5(SYS_getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen)); + return syscall5(.getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen)); } pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize { if (builtin.arch == .i386) { return socketcall(SC_sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags }); } - return syscall3(SYS_sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags); + return syscall3(.sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags); } pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize { @@ -872,7 +872,7 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize // batch-send all messages up to the current message if (next_unsent < i) { const batch_size = i - next_unsent; - const r = syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags); + const r = syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags); if (getErrno(r) != 0) return next_unsent; if (r < batch_size) return next_unsent + r; } @@ -888,68 +888,68 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize } if (next_unsent < kvlen or next_unsent == 0) { // want to make sure at least one syscall occurs (e.g. to trigger MSG_EOR) const batch_size = kvlen - next_unsent; - const r = syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags); + const r = syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags); if (getErrno(r) != 0) return r; return next_unsent + r; } return kvlen; } - return syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags); + return syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags); } pub fn connect(fd: i32, addr: *const c_void, len: socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len }); } - return syscall3(SYS_connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len); + return syscall3(.connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len); } pub fn recvmsg(fd: i32, msg: *msghdr, flags: u32) usize { if (builtin.arch == .i386) { return socketcall(SC_recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags }); } - return syscall3(SYS_recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags); + return syscall3(.recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags); } pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) }); } - return syscall6(SYS_recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen)); + return syscall6(.recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen)); } pub fn shutdown(fd: i32, how: i32) usize { if (builtin.arch == .i386) { return socketcall(SC_shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) }); } - return syscall2(SYS_shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how))); + return syscall2(.shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how))); } pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) }); } - return syscall3(SYS_bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len)); + return syscall3(.bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len)); } pub fn listen(fd: i32, backlog: u32) usize { if (builtin.arch == .i386) { return socketcall(SC_listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog }); } - return syscall2(SYS_listen, @bitCast(usize, @as(isize, fd)), backlog); + return syscall2(.listen, @bitCast(usize, @as(isize, fd)), backlog); } pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize { if (builtin.arch == .i386) { return socketcall(SC_sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) }); } - return syscall6(SYS_sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen)); + return syscall6(.sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen)); } pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize { - if (@hasDecl(@This(), "SYS_sendfile64")) { + if (@hasField(SYS, "sendfile64")) { return syscall4( - SYS_sendfile64, + .sendfile64, @bitCast(usize, @as(isize, outfd)), @bitCast(usize, @as(isize, infd)), @ptrToInt(offset), @@ -957,7 +957,7 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize { ); } else { return syscall4( - SYS_sendfile, + .sendfile, @bitCast(usize, @as(isize, outfd)), @bitCast(usize, @as(isize, infd)), @ptrToInt(offset), @@ -970,7 +970,7 @@ pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: [2]i32) usiz if (builtin.arch == .i386) { return socketcall(SC_socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]) }); } - return syscall4(SYS_socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0])); + return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0])); } pub fn accept(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize { @@ -984,45 +984,45 @@ pub fn accept4(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t, flags: if (builtin.arch == .i386) { return socketcall(SC_accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags }); } - return syscall4(SYS_accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags); + return syscall4(.accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags); } pub fn fstat(fd: i32, stat_buf: *Stat) usize { - if (@hasDecl(@This(), "SYS_fstat64")) { - return syscall2(SYS_fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf)); + if (@hasField(SYS, "fstat64")) { + return syscall2(.fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf)); } else { - return syscall2(SYS_fstat, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf)); + return syscall2(.fstat, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf)); } } pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize { - if (@hasDecl(@This(), "SYS_stat64")) { - return syscall2(SYS_stat64, @ptrToInt(pathname), @ptrToInt(statbuf)); + if (@hasField(SYS, "stat64")) { + return syscall2(.stat64, @ptrToInt(pathname), @ptrToInt(statbuf)); } else { - return syscall2(SYS_stat, @ptrToInt(pathname), @ptrToInt(statbuf)); + return syscall2(.stat, @ptrToInt(pathname), @ptrToInt(statbuf)); } } pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize { - if (@hasDecl(@This(), "SYS_lstat64")) { - return syscall2(SYS_lstat64, @ptrToInt(pathname), @ptrToInt(statbuf)); + if (@hasField(SYS, "lstat64")) { + return syscall2(.lstat64, @ptrToInt(pathname), @ptrToInt(statbuf)); } else { - return syscall2(SYS_lstat, @ptrToInt(pathname), @ptrToInt(statbuf)); + return syscall2(.lstat, @ptrToInt(pathname), @ptrToInt(statbuf)); } } pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize { - if (@hasDecl(@This(), "SYS_fstatat64")) { - return syscall4(SYS_fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); + if (@hasField(SYS, "fstatat64")) { + return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); } else { - return syscall4(SYS_fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); + return syscall4(.fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); } } pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize { - if (@hasDecl(@This(), "SYS_statx")) { + if (@hasField(SYS, "statx")) { return syscall5( - SYS_statx, + .statx, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, @@ -1034,59 +1034,59 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S } pub fn listxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize { - return syscall3(SYS_listxattr, @ptrToInt(path), @ptrToInt(list), size); + return syscall3(.listxattr, @ptrToInt(path), @ptrToInt(list), size); } pub fn llistxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize { - return syscall3(SYS_llistxattr, @ptrToInt(path), @ptrToInt(list), size); + return syscall3(.llistxattr, @ptrToInt(path), @ptrToInt(list), size); } pub fn flistxattr(fd: usize, list: [*]u8, size: usize) usize { - return syscall3(SYS_flistxattr, fd, @ptrToInt(list), size); + return syscall3(.flistxattr, fd, @ptrToInt(list), size); } pub fn getxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize { - return syscall4(SYS_getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); + return syscall4(.getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); } pub fn lgetxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize { - return syscall4(SYS_lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); + return syscall4(.lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); } pub fn fgetxattr(fd: usize, name: [*:0]const u8, value: [*]u8, size: usize) usize { - return syscall4(SYS_lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size); + return syscall4(.lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size); } pub fn setxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { - return syscall5(SYS_setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); + return syscall5(.setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); } pub fn lsetxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { - return syscall5(SYS_lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); + return syscall5(.lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); } pub fn fsetxattr(fd: usize, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { - return syscall5(SYS_fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags); + return syscall5(.fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags); } pub fn removexattr(path: [*:0]const u8, name: [*:0]const u8) usize { - return syscall2(SYS_removexattr, @ptrToInt(path), @ptrToInt(name)); + return syscall2(.removexattr, @ptrToInt(path), @ptrToInt(name)); } pub fn lremovexattr(path: [*:0]const u8, name: [*:0]const u8) usize { - return syscall2(SYS_lremovexattr, @ptrToInt(path), @ptrToInt(name)); + return syscall2(.lremovexattr, @ptrToInt(path), @ptrToInt(name)); } pub fn fremovexattr(fd: usize, name: [*:0]const u8) usize { - return syscall2(SYS_fremovexattr, fd, @ptrToInt(name)); + return syscall2(.fremovexattr, fd, @ptrToInt(name)); } pub fn sched_yield() usize { - return syscall0(SYS_sched_yield); + return syscall0(.sched_yield); } pub fn sched_getaffinity(pid: pid_t, size: usize, set: *cpu_set_t) usize { - const rc = syscall3(SYS_sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set)); + const rc = syscall3(.sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set)); if (@bitCast(isize, rc) < 0) return rc; if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc); return 0; @@ -1097,11 +1097,11 @@ pub fn epoll_create() usize { } pub fn epoll_create1(flags: usize) usize { - return syscall1(SYS_epoll_create1, flags); + return syscall1(.epoll_create1, flags); } pub fn epoll_ctl(epoll_fd: i32, op: u32, fd: i32, ev: ?*epoll_event) usize { - return syscall4(SYS_epoll_ctl, @bitCast(usize, @as(isize, epoll_fd)), @intCast(usize, op), @bitCast(usize, @as(isize, fd)), @ptrToInt(ev)); + return syscall4(.epoll_ctl, @bitCast(usize, @as(isize, epoll_fd)), @intCast(usize, op), @bitCast(usize, @as(isize, fd)), @ptrToInt(ev)); } pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32) usize { @@ -1110,7 +1110,7 @@ pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32, sigmask: ?*sigset_t) usize { return syscall6( - SYS_epoll_pwait, + .epoll_pwait, @bitCast(usize, @as(isize, epoll_fd)), @ptrToInt(events), @intCast(usize, maxevents), @@ -1121,11 +1121,11 @@ pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeou } pub fn eventfd(count: u32, flags: u32) usize { - return syscall2(SYS_eventfd2, count, flags); + return syscall2(.eventfd2, count, flags); } pub fn timerfd_create(clockid: i32, flags: u32) usize { - return syscall2(SYS_timerfd_create, @bitCast(usize, @as(isize, clockid)), flags); + return syscall2(.timerfd_create, @bitCast(usize, @as(isize, clockid)), flags); } pub const itimerspec = extern struct { @@ -1134,59 +1134,59 @@ pub const itimerspec = extern struct { }; pub fn timerfd_gettime(fd: i32, curr_value: *itimerspec) usize { - return syscall2(SYS_timerfd_gettime, @bitCast(usize, @as(isize, fd)), @ptrToInt(curr_value)); + return syscall2(.timerfd_gettime, @bitCast(usize, @as(isize, fd)), @ptrToInt(curr_value)); } pub fn timerfd_settime(fd: i32, flags: u32, new_value: *const itimerspec, old_value: ?*itimerspec) usize { - return syscall4(SYS_timerfd_settime, @bitCast(usize, @as(isize, fd)), flags, @ptrToInt(new_value), @ptrToInt(old_value)); + return syscall4(.timerfd_settime, @bitCast(usize, @as(isize, fd)), flags, @ptrToInt(new_value), @ptrToInt(old_value)); } pub fn unshare(flags: usize) usize { - return syscall1(SYS_unshare, flags); + return syscall1(.unshare, flags); } pub fn capget(hdrp: *cap_user_header_t, datap: *cap_user_data_t) usize { - return syscall2(SYS_capget, @ptrToInt(hdrp), @ptrToInt(datap)); + return syscall2(.capget, @ptrToInt(hdrp), @ptrToInt(datap)); } pub fn capset(hdrp: *cap_user_header_t, datap: *const cap_user_data_t) usize { - return syscall2(SYS_capset, @ptrToInt(hdrp), @ptrToInt(datap)); + return syscall2(.capset, @ptrToInt(hdrp), @ptrToInt(datap)); } pub fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) usize { - return syscall2(SYS_sigaltstack, @ptrToInt(ss), @ptrToInt(old_ss)); + return syscall2(.sigaltstack, @ptrToInt(ss), @ptrToInt(old_ss)); } pub fn uname(uts: *utsname) usize { - return syscall1(SYS_uname, @ptrToInt(uts)); + return syscall1(.uname, @ptrToInt(uts)); } pub fn io_uring_setup(entries: u32, p: *io_uring_params) usize { - return syscall2(SYS_io_uring_setup, entries, @ptrToInt(p)); + return syscall2(.io_uring_setup, entries, @ptrToInt(p)); } pub fn io_uring_enter(fd: i32, to_submit: u32, min_complete: u32, flags: u32, sig: ?*sigset_t) usize { - return syscall6(SYS_io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8); + return syscall6(.io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8); } pub fn io_uring_register(fd: i32, opcode: IORING_REGISTER, arg: ?*const c_void, nr_args: u32) usize { - return syscall4(SYS_io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args); + return syscall4(.io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args); } pub fn memfd_create(name: [*:0]const u8, flags: u32) usize { - return syscall2(SYS_memfd_create, @ptrToInt(name), flags); + return syscall2(.memfd_create, @ptrToInt(name), flags); } pub fn getrusage(who: i32, usage: *rusage) usize { - return syscall2(SYS_getrusage, @bitCast(usize, @as(isize, who)), @ptrToInt(usage)); + return syscall2(.getrusage, @bitCast(usize, @as(isize, who)), @ptrToInt(usage)); } pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize { - return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p)); + return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p)); } pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize { - return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p)); + return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p)); } test "" { diff --git a/lib/std/os/linux/arm-eabi.zig b/lib/std/os/linux/arm-eabi.zig index 0fbbbc4085..c052aeab4e 100644 --- a/lib/std/os/linux/arm-eabi.zig +++ b/lib/std/os/linux/arm-eabi.zig @@ -1,36 +1,36 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number) + : [number] "{r7}" (@enumToInt(number)) : "memory" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1) : "memory" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1), [arg2] "{r1}" (arg2) : "memory" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1), [arg2] "{r1}" (arg2), [arg3] "{r2}" (arg3) @@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1), [arg2] "{r1}" (arg2), [arg3] "{r2}" (arg3), @@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1), [arg2] "{r1}" (arg2), [arg3] "{r2}" (arg3), @@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -74,7 +74,7 @@ pub fn syscall6( ) usize { return asm volatile ("svc #0" : [ret] "={r0}" (-> usize) - : [number] "{r7}" (number), + : [number] "{r7}" (@enumToInt(number)), [arg1] "{r0}" (arg1), [arg2] "{r1}" (arg2), [arg3] "{r2}" (arg3), @@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a pub fn restore() callconv(.Naked) void { return asm volatile ("svc #0" : - : [number] "{r7}" (@as(usize, SYS_sigreturn)) + : [number] "{r7}" (@enumToInt(SYS.sigreturn)) : "memory" ); } @@ -99,7 +99,7 @@ pub fn restore() callconv(.Naked) void { pub fn restore_rt() callconv(.Naked) void { return asm volatile ("svc #0" : - : [number] "{r7}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{r7}" (@enumToInt(SYS.rt_sigreturn)) : "memory" ); } diff --git a/lib/std/os/linux/arm64.zig b/lib/std/os/linux/arm64.zig index f565bea489..52ab3656e0 100644 --- a/lib/std/os/linux/arm64.zig +++ b/lib/std/os/linux/arm64.zig @@ -1,36 +1,36 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number) + : [number] "{x8}" (@enumToInt(number)) : "memory", "cc" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1) : "memory", "cc" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1), [arg2] "{x1}" (arg2) : "memory", "cc" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1), [arg2] "{x1}" (arg2), [arg3] "{x2}" (arg3) @@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1), [arg2] "{x1}" (arg2), [arg3] "{x2}" (arg3), @@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1), [arg2] "{x1}" (arg2), [arg3] "{x2}" (arg3), @@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -74,7 +74,7 @@ pub fn syscall6( ) usize { return asm volatile ("svc #0" : [ret] "={x0}" (-> usize) - : [number] "{x8}" (number), + : [number] "{x8}" (@enumToInt(number)), [arg1] "{x0}" (arg1), [arg2] "{x1}" (arg2), [arg3] "{x2}" (arg3), @@ -93,7 +93,7 @@ pub const restore = restore_rt; pub fn restore_rt() callconv(.Naked) void { return asm volatile ("svc #0" : - : [number] "{x8}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{x8}" (@enumToInt(SYS.rt_sigreturn)) : "memory", "cc" ); } diff --git a/lib/std/os/linux/i386.zig b/lib/std/os/linux/i386.zig index ecdf361b63..0342f0754e 100644 --- a/lib/std/os/linux/i386.zig +++ b/lib/std/os/linux/i386.zig @@ -1,36 +1,36 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number) + : [number] "{eax}" (@enumToInt(number)) : "memory" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1) : "memory" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1), [arg2] "{ecx}" (arg2) : "memory" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1), [arg2] "{ecx}" (arg2), [arg3] "{edx}" (arg3) @@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1), [arg2] "{ecx}" (arg2), [arg3] "{edx}" (arg3), @@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1), [arg2] "{ecx}" (arg2), [arg3] "{edx}" (arg3), @@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -84,7 +84,7 @@ pub fn syscall6( \\ pop %%ebp \\ add $4, %%esp : [ret] "={eax}" (-> usize) - : [number] "{eax}" (number), + : [number] "{eax}" (@enumToInt(number)), [arg1] "{ebx}" (arg1), [arg2] "{ecx}" (arg2), [arg3] "{edx}" (arg3), @@ -98,7 +98,7 @@ pub fn syscall6( pub fn socketcall(call: usize, args: [*]usize) usize { return asm volatile ("int $0x80" : [ret] "={eax}" (-> usize) - : [number] "{eax}" (@as(usize, SYS_socketcall)), + : [number] "{eax}" (@enumToInt(SYS.socketcall)), [arg1] "{ebx}" (call), [arg2] "{ecx}" (@ptrToInt(args)) : "memory" @@ -111,7 +111,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a pub fn restore() callconv(.Naked) void { return asm volatile ("int $0x80" : - : [number] "{eax}" (@as(usize, SYS_sigreturn)) + : [number] "{eax}" (@enumToInt(SYS.sigreturn)) : "memory" ); } @@ -119,7 +119,7 @@ pub fn restore() callconv(.Naked) void { pub fn restore_rt() callconv(.Naked) void { return asm volatile ("int $0x80" : - : [number] "{eax}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{eax}" (@enumToInt(SYS.rt_sigreturn)) : "memory" ); } diff --git a/lib/std/os/linux/mipsel.zig b/lib/std/os/linux/mipsel.zig index 5193133f6c..87c55db9f6 100644 --- a/lib/std/os/linux/mipsel.zig +++ b/lib/std/os/linux/mipsel.zig @@ -1,13 +1,13 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ( \\ syscall \\ blez $7, 1f \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number) + : [number] "{$2}" (@enumToInt(number)) : "memory", "cc", "$7" ); } @@ -26,46 +26,46 @@ pub fn syscall_pipe(fd: *[2]i32) usize { \\ sw $3, 4($4) \\ 2: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (@as(usize, SYS_pipe)) + : [number] "{$2}" (@enumToInt(SYS.pipe)) : "memory", "cc", "$7" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ( \\ syscall \\ blez $7, 1f \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1) : "memory", "cc", "$7" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ( \\ syscall \\ blez $7, 1f \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1), [arg2] "{$5}" (arg2) : "memory", "cc", "$7" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ( \\ syscall \\ blez $7, 1f \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1), [arg2] "{$5}" (arg2), [arg3] "{$6}" (arg3) @@ -73,14 +73,14 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ( \\ syscall \\ blez $7, 1f \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1), [arg2] "{$5}" (arg2), [arg3] "{$6}" (arg3), @@ -89,7 +89,7 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ( \\ .set noat \\ subu $sp, $sp, 24 @@ -100,7 +100,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1), [arg2] "{$5}" (arg2), [arg3] "{$6}" (arg3), @@ -111,7 +111,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -130,7 +130,7 @@ pub fn syscall6( \\ subu $2, $0, $2 \\ 1: : [ret] "={$2}" (-> usize) - : [number] "{$2}" (number), + : [number] "{$2}" (@enumToInt(number)), [arg1] "{$4}" (arg1), [arg2] "{$5}" (arg2), [arg3] "{$6}" (arg3), @@ -147,7 +147,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a pub fn restore() callconv(.Naked) void { return asm volatile ("syscall" : - : [number] "{$2}" (@as(usize, SYS_sigreturn)) + : [number] "{$2}" (@enumToInt(SYS.sigreturn)) : "memory", "cc", "$7" ); } @@ -155,7 +155,7 @@ pub fn restore() callconv(.Naked) void { pub fn restore_rt() callconv(.Naked) void { return asm volatile ("syscall" : - : [number] "{$2}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{$2}" (@enumToInt(SYS.rt_sigreturn)) : "memory", "cc", "$7" ); } diff --git a/lib/std/os/linux/riscv64.zig b/lib/std/os/linux/riscv64.zig index 2259dad78e..3832bfbcca 100644 --- a/lib/std/os/linux/riscv64.zig +++ b/lib/std/os/linux/riscv64.zig @@ -1,36 +1,36 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number) + : [number] "{x17}" (@enumToInt(number)) : "memory" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1) : "memory" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1), [arg2] "{x11}" (arg2) : "memory" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1), [arg2] "{x11}" (arg2), [arg3] "{x12}" (arg3) @@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1), [arg2] "{x11}" (arg2), [arg3] "{x12}" (arg3), @@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1), [arg2] "{x11}" (arg2), [arg3] "{x12}" (arg3), @@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -74,7 +74,7 @@ pub fn syscall6( ) usize { return asm volatile ("ecall" : [ret] "={x10}" (-> usize) - : [number] "{x17}" (number), + : [number] "{x17}" (@enumToInt(number)), [arg1] "{x10}" (arg1), [arg2] "{x11}" (arg2), [arg3] "{x12}" (arg3), @@ -92,7 +92,7 @@ pub const restore = restore_rt; pub fn restore_rt() callconv(.Naked) void { return asm volatile ("ecall" : - : [number] "{x17}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{x17}" (@enumToInt(SYS.rt_sigreturn)) : "memory" ); } diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig index 1c57fd06b9..e7d836eff6 100644 --- a/lib/std/os/linux/tls.zig +++ b/lib/std/os/linux/tls.zig @@ -122,7 +122,7 @@ pub fn setThreadPointer(addr: usize) void { .seg_not_present = 0, .useable = 1, }; - const rc = std.os.linux.syscall1(std.os.linux.SYS_set_thread_area, @ptrToInt(&user_desc)); + const rc = std.os.linux.syscall1(.set_thread_area, @ptrToInt(&user_desc)); assert(rc == 0); const gdt_entry_number = user_desc.entry_number; @@ -135,7 +135,7 @@ pub fn setThreadPointer(addr: usize) void { ); }, .x86_64 => { - const rc = std.os.linux.syscall2(std.os.linux.SYS_arch_prctl, std.os.linux.ARCH_SET_FS, addr); + const rc = std.os.linux.syscall2(.arch_prctl, std.os.linux.ARCH_SET_FS, addr); assert(rc == 0); }, .aarch64 => { @@ -146,7 +146,7 @@ pub fn setThreadPointer(addr: usize) void { ); }, .arm => { - const rc = std.os.linux.syscall1(std.os.linux.SYS_set_tls, addr); + const rc = std.os.linux.syscall1(.set_tls, addr); assert(rc == 0); }, .riscv64 => { @@ -157,7 +157,7 @@ pub fn setThreadPointer(addr: usize) void { ); }, .mipsel => { - const rc = std.os.linux.syscall1(std.os.linux.SYS_set_thread_area, addr); + const rc = std.os.linux.syscall1(.set_thread_area, addr); assert(rc == 0); }, else => @compileError("Unsupported architecture"), diff --git a/lib/std/os/linux/x86_64.zig b/lib/std/os/linux/x86_64.zig index d6067f9b18..b60dcd80e9 100644 --- a/lib/std/os/linux/x86_64.zig +++ b/lib/std/os/linux/x86_64.zig @@ -1,36 +1,36 @@ usingnamespace @import("../bits.zig"); -pub fn syscall0(number: usize) usize { +pub fn syscall0(number: SYS) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number) + : [number] "{rax}" (@enumToInt(number)) : "rcx", "r11", "memory" ); } -pub fn syscall1(number: usize, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: usize) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1) : "rcx", "r11", "memory" ); } -pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2) : "rcx", "r11", "memory" ); } -pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3) @@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { ); } -pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3), @@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz ); } -pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3), @@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz } pub fn syscall6( - number: usize, + number: SYS, arg1: usize, arg2: usize, arg3: usize, @@ -74,7 +74,7 @@ pub fn syscall6( ) usize { return asm volatile ("syscall" : [ret] "={rax}" (-> usize) - : [number] "{rax}" (number), + : [number] "{rax}" (@enumToInt(number)), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3), @@ -93,7 +93,7 @@ pub const restore = restore_rt; pub fn restore_rt() callconv(.Naked) void { return asm volatile ("syscall" : - : [number] "{rax}" (@as(usize, SYS_rt_sigreturn)) + : [number] "{rax}" (@enumToInt(SYS.rt_sigreturn)) : "rcx", "r11", "memory" ); } diff --git a/lib/std/special/compiler_rt/clear_cache.zig b/lib/std/special/compiler_rt/clear_cache.zig index 984ef7e7ac..1795a6e829 100644 --- a/lib/std/special/compiler_rt/clear_cache.zig +++ b/lib/std/special/compiler_rt/clear_cache.zig @@ -54,7 +54,7 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void { // sysarch(ARM_SYNC_ICACHE, &arg); @compileError("TODO: implement for NetBSD/FreeBSD"); } else if (os == .linux) { - const result = std.os.linux.syscall3(std.os.linux.SYS_cacheflush, start, end, 0); + const result = std.os.linux.syscall3(.cacheflush, start, end, 0); std.debug.assert(result == 0); } else { @compileError("no __clear_cache implementation available for this target");