| ... | ... | @@ -0,0 +1,510 @@ |
| 1 | // arm-eabi-specific declarations that are intended to be imported into the POSIX namespace. |
| 2 | |
| 3 | const std = @import("../../std.zig"); |
| 4 | const linux = std.os.linux; |
| 5 | const socklen_t = linux.socklen_t; |
| 6 | const iovec = linux.iovec; |
| 7 | const iovec_const = linux.iovec_const; |
| 8 | |
| 9 | pub const SYS_restart_syscall = 0; |
| 10 | pub const SYS_exit = 1; |
| 11 | pub const SYS_fork = 2; |
| 12 | pub const SYS_read = 3; |
| 13 | pub const SYS_write = 4; |
| 14 | pub const SYS_open = 5; |
| 15 | pub const SYS_close = 6; |
| 16 | pub const SYS_creat = 8; |
| 17 | pub const SYS_link = 9; |
| 18 | pub const SYS_unlink = 10; |
| 19 | pub const SYS_execve = 11; |
| 20 | pub const SYS_chdir = 12; |
| 21 | pub const SYS_mknod = 14; |
| 22 | pub const SYS_chmod = 15; |
| 23 | pub const SYS_lchown = 16; |
| 24 | pub const SYS_lseek = 19; |
| 25 | pub const SYS_getpid = 20; |
| 26 | pub const SYS_mount = 21; |
| 27 | pub const SYS_setuid = 23; |
| 28 | pub const SYS_getuid = 24; |
| 29 | pub const SYS_ptrace = 26; |
| 30 | pub const SYS_pause = 29; |
| 31 | pub const SYS_access = 33; |
| 32 | pub const SYS_nice = 34; |
| 33 | pub const SYS_sync = 36; |
| 34 | pub const SYS_kill = 37; |
| 35 | pub const SYS_rename = 38; |
| 36 | pub const SYS_mkdir = 39; |
| 37 | pub const SYS_rmdir = 40; |
| 38 | pub const SYS_dup = 41; |
| 39 | pub const SYS_pipe = 42; |
| 40 | pub const SYS_times = 43; |
| 41 | pub const SYS_brk = 45; |
| 42 | pub const SYS_setgid = 46; |
| 43 | pub const SYS_getgid = 47; |
| 44 | pub const SYS_geteuid = 49; |
| 45 | pub const SYS_getegid = 50; |
| 46 | pub const SYS_acct = 51; |
| 47 | pub const SYS_umount2 = 52; |
| 48 | pub const SYS_ioctl = 54; |
| 49 | pub const SYS_fcntl = 55; |
| 50 | pub const SYS_setpgid = 57; |
| 51 | pub const SYS_umask = 60; |
| 52 | pub const SYS_chroot = 61; |
| 53 | pub const SYS_ustat = 62; |
| 54 | pub const SYS_dup2 = 63; |
| 55 | pub const SYS_getppid = 64; |
| 56 | pub const SYS_getpgrp = 65; |
| 57 | pub const SYS_setsid = 66; |
| 58 | pub const SYS_sigaction = 67; |
| 59 | pub const SYS_setreuid = 70; |
| 60 | pub const SYS_setregid = 71; |
| 61 | pub const SYS_sigsuspend = 72; |
| 62 | pub const SYS_sigpending = 73; |
| 63 | pub const SYS_sethostname = 74; |
| 64 | pub const SYS_setrlimit = 75; |
| 65 | pub const SYS_getrusage = 77; |
| 66 | pub const SYS_gettimeofday = 78; |
| 67 | pub const SYS_settimeofday = 79; |
| 68 | pub const SYS_getgroups = 80; |
| 69 | pub const SYS_setgroups = 81; |
| 70 | pub const SYS_symlink = 83; |
| 71 | pub const SYS_readlink = 85; |
| 72 | pub const SYS_uselib = 86; |
| 73 | pub const SYS_swapon = 87; |
| 74 | pub const SYS_reboot = 88; |
| 75 | pub const SYS_munmap = 91; |
| 76 | pub const SYS_truncate = 92; |
| 77 | pub const SYS_ftruncate = 93; |
| 78 | pub const SYS_fchmod = 94; |
| 79 | pub const SYS_fchown = 95; |
| 80 | pub const SYS_getpriority = 96; |
| 81 | pub const SYS_setpriority = 97; |
| 82 | pub const SYS_statfs = 99; |
| 83 | pub const SYS_fstatfs = 100; |
| 84 | pub const SYS_syslog = 103; |
| 85 | pub const SYS_setitimer = 104; |
| 86 | pub const SYS_getitimer = 105; |
| 87 | pub const SYS_stat = 106; |
| 88 | pub const SYS_lstat = 107; |
| 89 | pub const SYS_fstat = 108; |
| 90 | pub const SYS_vhangup = 111; |
| 91 | pub const SYS_wait4 = 114; |
| 92 | pub const SYS_swapoff = 115; |
| 93 | pub const SYS_sysinfo = 116; |
| 94 | pub const SYS_fsync = 118; |
| 95 | pub const SYS_sigreturn = 119; |
| 96 | pub const SYS_clone = 120; |
| 97 | pub const SYS_setdomainname = 121; |
| 98 | pub const SYS_uname = 122; |
| 99 | pub const SYS_adjtimex = 124; |
| 100 | pub const SYS_mprotect = 125; |
| 101 | pub const SYS_sigprocmask = 126; |
| 102 | pub const SYS_init_module = 128; |
| 103 | pub const SYS_delete_module = 129; |
| 104 | pub const SYS_quotactl = 131; |
| 105 | pub const SYS_getpgid = 132; |
| 106 | pub const SYS_fchdir = 133; |
| 107 | pub const SYS_bdflush = 134; |
| 108 | pub const SYS_sysfs = 135; |
| 109 | pub const SYS_personality = 136; |
| 110 | pub const SYS_setfsuid = 138; |
| 111 | pub const SYS_setfsgid = 139; |
| 112 | pub const SYS__llseek = 140; |
| 113 | pub const SYS_getdents = 141; |
| 114 | pub const SYS__newselect = 142; |
| 115 | pub const SYS_flock = 143; |
| 116 | pub const SYS_msync = 144; |
| 117 | pub const SYS_readv = 145; |
| 118 | pub const SYS_writev = 146; |
| 119 | pub const SYS_getsid = 147; |
| 120 | pub const SYS_fdatasync = 148; |
| 121 | pub const SYS__sysctl = 149; |
| 122 | pub const SYS_mlock = 150; |
| 123 | pub const SYS_munlock = 151; |
| 124 | pub const SYS_mlockall = 152; |
| 125 | pub const SYS_munlockall = 153; |
| 126 | pub const SYS_sched_setparam = 154; |
| 127 | pub const SYS_sched_getparam = 155; |
| 128 | pub const SYS_sched_setscheduler = 156; |
| 129 | pub const SYS_sched_getscheduler = 157; |
| 130 | pub const SYS_sched_yield = 158; |
| 131 | pub const SYS_sched_get_priority_max = 159; |
| 132 | pub const SYS_sched_get_priority_min = 160; |
| 133 | pub const SYS_sched_rr_get_interval = 161; |
| 134 | pub const SYS_nanosleep = 162; |
| 135 | pub const SYS_mremap = 163; |
| 136 | pub const SYS_setresuid = 164; |
| 137 | pub const SYS_getresuid = 165; |
| 138 | pub const SYS_poll = 168; |
| 139 | pub const SYS_nfsservctl = 169; |
| 140 | pub const SYS_setresgid = 170; |
| 141 | pub const SYS_getresgid = 171; |
| 142 | pub const SYS_prctl = 172; |
| 143 | pub const SYS_rt_sigreturn = 173; |
| 144 | pub const SYS_rt_sigaction = 174; |
| 145 | pub const SYS_rt_sigprocmask = 175; |
| 146 | pub const SYS_rt_sigpending = 176; |
| 147 | pub const SYS_rt_sigtimedwait = 177; |
| 148 | pub const SYS_rt_sigqueueinfo = 178; |
| 149 | pub const SYS_rt_sigsuspend = 179; |
| 150 | pub const SYS_pread64 = 180; |
| 151 | pub const SYS_pwrite64 = 181; |
| 152 | pub const SYS_chown = 182; |
| 153 | pub const SYS_getcwd = 183; |
| 154 | pub const SYS_capget = 184; |
| 155 | pub const SYS_capset = 185; |
| 156 | pub const SYS_sigaltstack = 186; |
| 157 | pub const SYS_sendfile = 187; |
| 158 | pub const SYS_vfork = 190; |
| 159 | pub const SYS_ugetrlimit = 191; |
| 160 | pub const SYS_mmap2 = 192; |
| 161 | pub const SYS_truncate64 = 193; |
| 162 | pub const SYS_ftruncate64 = 194; |
| 163 | pub const SYS_stat64 = 195; |
| 164 | pub const SYS_lstat64 = 196; |
| 165 | pub const SYS_fstat64 = 197; |
| 166 | pub const SYS_lchown32 = 198; |
| 167 | pub const SYS_getuid32 = 199; |
| 168 | pub const SYS_getgid32 = 200; |
| 169 | pub const SYS_geteuid32 = 201; |
| 170 | pub const SYS_getegid32 = 202; |
| 171 | pub const SYS_setreuid32 = 203; |
| 172 | pub const SYS_setregid32 = 204; |
| 173 | pub const SYS_getgroups32 = 205; |
| 174 | pub const SYS_setgroups32 = 206; |
| 175 | pub const SYS_fchown32 = 207; |
| 176 | pub const SYS_setresuid32 = 208; |
| 177 | pub const SYS_getresuid32 = 209; |
| 178 | pub const SYS_setresgid32 = 210; |
| 179 | pub const SYS_getresgid32 = 211; |
| 180 | pub const SYS_chown32 = 212; |
| 181 | pub const SYS_setuid32 = 213; |
| 182 | pub const SYS_setgid32 = 214; |
| 183 | pub const SYS_setfsuid32 = 215; |
| 184 | pub const SYS_setfsgid32 = 216; |
| 185 | pub const SYS_getdents64 = 217; |
| 186 | pub const SYS_pivot_root = 218; |
| 187 | pub const SYS_mincore = 219; |
| 188 | pub const SYS_madvise = 220; |
| 189 | pub const SYS_fcntl64 = 221; |
| 190 | pub const SYS_gettid = 224; |
| 191 | pub const SYS_readahead = 225; |
| 192 | pub const SYS_setxattr = 226; |
| 193 | pub const SYS_lsetxattr = 227; |
| 194 | pub const SYS_fsetxattr = 228; |
| 195 | pub const SYS_getxattr = 229; |
| 196 | pub const SYS_lgetxattr = 230; |
| 197 | pub const SYS_fgetxattr = 231; |
| 198 | pub const SYS_listxattr = 232; |
| 199 | pub const SYS_llistxattr = 233; |
| 200 | pub const SYS_flistxattr = 234; |
| 201 | pub const SYS_removexattr = 235; |
| 202 | pub const SYS_lremovexattr = 236; |
| 203 | pub const SYS_fremovexattr = 237; |
| 204 | pub const SYS_tkill = 238; |
| 205 | pub const SYS_sendfile64 = 239; |
| 206 | pub const SYS_futex = 240; |
| 207 | pub const SYS_sched_setaffinity = 241; |
| 208 | pub const SYS_sched_getaffinity = 242; |
| 209 | pub const SYS_io_setup = 243; |
| 210 | pub const SYS_io_destroy = 244; |
| 211 | pub const SYS_io_getevents = 245; |
| 212 | pub const SYS_io_submit = 246; |
| 213 | pub const SYS_io_cancel = 247; |
| 214 | pub const SYS_exit_group = 248; |
| 215 | pub const SYS_lookup_dcookie = 249; |
| 216 | pub const SYS_epoll_create = 250; |
| 217 | pub const SYS_epoll_ctl = 251; |
| 218 | pub const SYS_epoll_wait = 252; |
| 219 | pub const SYS_remap_file_pages = 253; |
| 220 | pub const SYS_set_tid_address = 256; |
| 221 | pub const SYS_timer_create = 257; |
| 222 | pub const SYS_timer_settime = 258; |
| 223 | pub const SYS_timer_gettime = 259; |
| 224 | pub const SYS_timer_getoverrun = 260; |
| 225 | pub const SYS_timer_delete = 261; |
| 226 | pub const SYS_clock_settime = 262; |
| 227 | pub const SYS_clock_gettime = 263; |
| 228 | pub const SYS_clock_getres = 264; |
| 229 | pub const SYS_clock_nanosleep = 265; |
| 230 | pub const SYS_statfs64 = 266; |
| 231 | pub const SYS_fstatfs64 = 267; |
| 232 | pub const SYS_tgkill = 268; |
| 233 | pub const SYS_utimes = 269; |
| 234 | pub const SYS_arm_fadvise64_64 = 270; |
| 235 | pub const SYS_pciconfig_iobase = 271; |
| 236 | pub const SYS_pciconfig_read = 272; |
| 237 | pub const SYS_pciconfig_write = 273; |
| 238 | pub const SYS_mq_open = 274; |
| 239 | pub const SYS_mq_unlink = 275; |
| 240 | pub const SYS_mq_timedsend = 276; |
| 241 | pub const SYS_mq_timedreceive = 277; |
| 242 | pub const SYS_mq_notify = 278; |
| 243 | pub const SYS_mq_getsetattr = 279; |
| 244 | pub const SYS_waitid = 280; |
| 245 | pub const SYS_socket = 281; |
| 246 | pub const SYS_bind = 282; |
| 247 | pub const SYS_connect = 283; |
| 248 | pub const SYS_listen = 284; |
| 249 | pub const SYS_accept = 285; |
| 250 | pub const SYS_getsockname = 286; |
| 251 | pub const SYS_getpeername = 287; |
| 252 | pub const SYS_socketpair = 288; |
| 253 | pub const SYS_send = 289; |
| 254 | pub const SYS_sendto = 290; |
| 255 | pub const SYS_recv = 291; |
| 256 | pub const SYS_recvfrom = 292; |
| 257 | pub const SYS_shutdown = 293; |
| 258 | pub const SYS_setsockopt = 294; |
| 259 | pub const SYS_getsockopt = 295; |
| 260 | pub const SYS_sendmsg = 296; |
| 261 | pub const SYS_recvmsg = 297; |
| 262 | pub const SYS_semop = 298; |
| 263 | pub const SYS_semget = 299; |
| 264 | pub const SYS_semctl = 300; |
| 265 | pub const SYS_msgsnd = 301; |
| 266 | pub const SYS_msgrcv = 302; |
| 267 | pub const SYS_msgget = 303; |
| 268 | pub const SYS_msgctl = 304; |
| 269 | pub const SYS_shmat = 305; |
| 270 | pub const SYS_shmdt = 306; |
| 271 | pub const SYS_shmget = 307; |
| 272 | pub const SYS_shmctl = 308; |
| 273 | pub const SYS_add_key = 309; |
| 274 | pub const SYS_request_key = 310; |
| 275 | pub const SYS_keyctl = 311; |
| 276 | pub const SYS_semtimedop = 312; |
| 277 | pub const SYS_vserver = 313; |
| 278 | pub const SYS_ioprio_set = 314; |
| 279 | pub const SYS_ioprio_get = 315; |
| 280 | pub const SYS_inotify_init = 316; |
| 281 | pub const SYS_inotify_add_watch = 317; |
| 282 | pub const SYS_inotify_rm_watch = 318; |
| 283 | pub const SYS_mbind = 319; |
| 284 | pub const SYS_get_mempolicy = 320; |
| 285 | pub const SYS_set_mempolicy = 321; |
| 286 | pub const SYS_openat = 322; |
| 287 | pub const SYS_mkdirat = 323; |
| 288 | pub const SYS_mknodat = 324; |
| 289 | pub const SYS_fchownat = 325; |
| 290 | pub const SYS_futimesat = 326; |
| 291 | pub const SYS_fstatat64 = 327; |
| 292 | pub const SYS_unlinkat = 328; |
| 293 | pub const SYS_renameat = 329; |
| 294 | pub const SYS_linkat = 330; |
| 295 | pub const SYS_symlinkat = 331; |
| 296 | pub const SYS_readlinkat = 332; |
| 297 | pub const SYS_fchmodat = 333; |
| 298 | pub const SYS_faccessat = 334; |
| 299 | pub const SYS_pselect6 = 335; |
| 300 | pub const SYS_ppoll = 336; |
| 301 | pub const SYS_unshare = 337; |
| 302 | pub const SYS_set_robust_list = 338; |
| 303 | pub const SYS_get_robust_list = 339; |
| 304 | pub const SYS_splice = 340; |
| 305 | pub const SYS_arm_sync_file_range = 341; |
| 306 | pub const SYS_tee = 342; |
| 307 | pub const SYS_vmsplice = 343; |
| 308 | pub const SYS_move_pages = 344; |
| 309 | pub const SYS_getcpu = 345; |
| 310 | pub const SYS_epoll_pwait = 346; |
| 311 | pub const SYS_kexec_load = 347; |
| 312 | pub const SYS_utimensat = 348; |
| 313 | pub const SYS_signalfd = 349; |
| 314 | pub const SYS_timerfd_create = 350; |
| 315 | pub const SYS_eventfd = 351; |
| 316 | pub const SYS_fallocate = 352; |
| 317 | pub const SYS_timerfd_settime = 353; |
| 318 | pub const SYS_timerfd_gettime = 354; |
| 319 | pub const SYS_signalfd4 = 355; |
| 320 | pub const SYS_eventfd2 = 356; |
| 321 | pub const SYS_epoll_create1 = 357; |
| 322 | pub const SYS_dup3 = 358; |
| 323 | pub const SYS_pipe2 = 359; |
| 324 | pub const SYS_inotify_init1 = 360; |
| 325 | pub const SYS_preadv = 361; |
| 326 | pub const SYS_pwritev = 362; |
| 327 | pub const SYS_rt_tgsigqueueinfo = 363; |
| 328 | pub const SYS_perf_event_open = 364; |
| 329 | pub const SYS_recvmmsg = 365; |
| 330 | pub const SYS_accept4 = 366; |
| 331 | pub const SYS_fanotify_init = 367; |
| 332 | pub const SYS_fanotify_mark = 368; |
| 333 | pub const SYS_prlimit64 = 369; |
| 334 | pub const SYS_name_to_handle_at = 370; |
| 335 | pub const SYS_open_by_handle_at = 371; |
| 336 | pub const SYS_clock_adjtime = 372; |
| 337 | pub const SYS_syncfs = 373; |
| 338 | pub const SYS_sendmmsg = 374; |
| 339 | pub const SYS_setns = 375; |
| 340 | pub const SYS_process_vm_readv = 376; |
| 341 | pub const SYS_process_vm_writev = 377; |
| 342 | pub const SYS_kcmp = 378; |
| 343 | pub const SYS_finit_module = 379; |
| 344 | pub const SYS_sched_setattr = 380; |
| 345 | pub const SYS_sched_getattr = 381; |
| 346 | pub const SYS_renameat2 = 382; |
| 347 | pub const SYS_seccomp = 383; |
| 348 | pub const SYS_getrandom = 384; |
| 349 | pub const SYS_memfd_create = 385; |
| 350 | pub const SYS_bpf = 386; |
| 351 | pub const SYS_execveat = 387; |
| 352 | pub const SYS_userfaultfd = 388; |
| 353 | pub const SYS_membarrier = 389; |
| 354 | pub const SYS_mlock2 = 390; |
| 355 | pub const SYS_copy_file_range = 391; |
| 356 | pub const SYS_preadv2 = 392; |
| 357 | pub const SYS_pwritev2 = 393; |
| 358 | pub const SYS_pkey_mprotect = 394; |
| 359 | pub const SYS_pkey_alloc = 395; |
| 360 | pub const SYS_pkey_free = 396; |
| 361 | pub const SYS_statx = 397; |
| 362 | pub const SYS_rseq = 398; |
| 363 | pub const SYS_io_pgetevents = 399; |
| 364 | |
| 365 | pub const O_CREAT = 0o100; |
| 366 | pub const O_EXCL = 0o200; |
| 367 | pub const O_NOCTTY = 0o400; |
| 368 | pub const O_TRUNC = 0o1000; |
| 369 | pub const O_APPEND = 0o2000; |
| 370 | pub const O_NONBLOCK = 0o4000; |
| 371 | pub const O_DSYNC = 0o10000; |
| 372 | pub const O_SYNC = 0o4010000; |
| 373 | pub const O_RSYNC = 0o4010000; |
| 374 | pub const O_DIRECTORY = 0o40000; |
| 375 | pub const O_NOFOLLOW = 0o100000; |
| 376 | pub const O_CLOEXEC = 0o2000000; |
| 377 | |
| 378 | pub const O_ASYNC = 0o20000; |
| 379 | pub const O_DIRECT = 0o200000; |
| 380 | pub const O_LARGEFILE = 0o400000; |
| 381 | pub const O_NOATIME = 0o1000000; |
| 382 | pub const O_PATH = 0o10000000; |
| 383 | pub const O_TMPFILE = 0o20040000; |
| 384 | pub const O_NDELAY = O_NONBLOCK; |
| 385 | |
| 386 | pub const F_DUPFD = 0; |
| 387 | pub const F_GETFD = 1; |
| 388 | pub const F_SETFD = 2; |
| 389 | pub const F_GETFL = 3; |
| 390 | pub const F_SETFL = 4; |
| 391 | |
| 392 | pub const F_SETOWN = 8; |
| 393 | pub const F_GETOWN = 9; |
| 394 | pub const F_SETSIG = 10; |
| 395 | pub const F_GETSIG = 11; |
| 396 | |
| 397 | pub const F_GETLK = 12; |
| 398 | pub const F_SETLK = 13; |
| 399 | pub const F_SETLKW = 14; |
| 400 | |
| 401 | pub const F_SETOWN_EX = 15; |
| 402 | pub const F_GETOWN_EX = 16; |
| 403 | |
| 404 | pub const F_GETOWNER_UIDS = 17; |
| 405 | |
| 406 | /// stack-like segment |
| 407 | pub const MAP_GROWSDOWN = 0x0100; |
| 408 | |
| 409 | /// ETXTBSY |
| 410 | pub const MAP_DENYWRITE = 0x0800; |
| 411 | |
| 412 | /// mark it as an executable |
| 413 | pub const MAP_EXECUTABLE = 0x1000; |
| 414 | |
| 415 | /// pages are locked |
| 416 | pub const MAP_LOCKED = 0x2000; |
| 417 | |
| 418 | /// don't check for reservations |
| 419 | pub const MAP_NORESERVE = 0x4000; |
| 420 | |
| 421 | /// populate (prefault) pagetables |
| 422 | pub const MAP_POPULATE = 0x8000; |
| 423 | |
| 424 | /// do not block on IO |
| 425 | pub const MAP_NONBLOCK = 0x10000; |
| 426 | |
| 427 | /// give out an address that is best suited for process/thread stacks |
| 428 | pub const MAP_STACK = 0x20000; |
| 429 | |
| 430 | /// create a huge page mapping |
| 431 | pub const MAP_HUGETLB = 0x40000; |
| 432 | |
| 433 | /// perform synchronous page faults for the mapping |
| 434 | pub const MAP_SYNC = 0x80000; |
| 435 | |
| 436 | pub const VDSO_USEFUL = true; |
| 437 | pub const VDSO_CGT_SYM = "__vdso_clock_gettime"; |
| 438 | pub const VDSO_CGT_VER = "LINUX_2.6"; |
| 439 | |
| 440 | pub const msghdr = extern struct { |
| 441 | msg_name: ?*sockaddr, |
| 442 | msg_namelen: socklen_t, |
| 443 | msg_iov: [*]iovec, |
| 444 | msg_iovlen: i32, |
| 445 | msg_control: ?*c_void, |
| 446 | msg_controllen: socklen_t, |
| 447 | msg_flags: i32, |
| 448 | }; |
| 449 | |
| 450 | pub const msghdr_const = extern struct { |
| 451 | msg_name: ?*const sockaddr, |
| 452 | msg_namelen: socklen_t, |
| 453 | msg_iov: [*]iovec_const, |
| 454 | msg_iovlen: i32, |
| 455 | msg_control: ?*c_void, |
| 456 | msg_controllen: socklen_t, |
| 457 | msg_flags: i32, |
| 458 | }; |
| 459 | |
| 460 | /// Renamed to Stat to not conflict with the stat function. |
| 461 | /// atime, mtime, and ctime have functions to return `timespec`, |
| 462 | /// because although this is a POSIX API, the layout and names of |
| 463 | /// the structs are inconsistent across operating systems, and |
| 464 | /// in C, macros are used to hide the differences. Here we use |
| 465 | /// methods to accomplish this. |
| 466 | pub const Stat = extern struct { |
| 467 | dev: u64, |
| 468 | __dev_patting: u32, |
| 469 | __ino_truncated: u32, |
| 470 | mode: u32, |
| 471 | nlink: u32, |
| 472 | uid: u32, |
| 473 | gid: u32, |
| 474 | rdev: u64, |
| 475 | __rdev_padding: u32, |
| 476 | size: i64, |
| 477 | blksize: i32, |
| 478 | blocks: i64, |
| 479 | atim: timespec, |
| 480 | mtim: timespec, |
| 481 | ctim: timespec, |
| 482 | ino: u64, |
| 483 | |
| 484 | pub fn atime(self: Stat) timespec { |
| 485 | return self.atim; |
| 486 | } |
| 487 | |
| 488 | pub fn mtime(self: Stat) timespec { |
| 489 | return self.mtim; |
| 490 | } |
| 491 | |
| 492 | pub fn ctime(self: Stat) timespec { |
| 493 | return self.ctim; |
| 494 | } |
| 495 | }; |
| 496 | |
| 497 | pub const timespec = extern struct { |
| 498 | tv_sec: i32, |
| 499 | tv_nsec: i32, |
| 500 | }; |
| 501 | |
| 502 | pub const timeval = extern struct { |
| 503 | tv_sec: i32, |
| 504 | tv_usec: i32, |
| 505 | }; |
| 506 | |
| 507 | pub const timezone = extern struct { |
| 508 | tz_minuteswest: i32, |
| 509 | tz_dsttime: i32, |
| 510 | }; |