| ... | ... | @@ -6,6 +6,8 @@ const iovec = linux.iovec; |
| 6 | 6 | const iovec_const = linux.iovec_const; |
| 7 | 7 | const stack_t = linux.stack_t; |
| 8 | 8 | const sigset_t = linux.sigset_t; |
| 9 | const uid_t = linux.uid_t; |
| 10 | const gid_t = linux.gid_t; |
| 9 | 11 | |
| 10 | 12 | pub const SYS_restart_syscall = 0; |
| 11 | 13 | pub const SYS_exit = 1; |
| ... | ... | @@ -512,7 +514,14 @@ pub const msghdr_const = extern struct { |
| 512 | 514 | msg_flags: i32, |
| 513 | 515 | }; |
| 514 | 516 | |
| 517 | pub const blksize_t = i32; |
| 518 | pub const nlink_t = u32; |
| 519 | pub const time_t = isize; |
| 520 | pub const mode_t = u32; |
| 515 | 521 | pub const off_t = i64; |
| 522 | pub const ino_t = u64; |
| 523 | pub const dev_t = u64; |
| 524 | pub const blkcnt_t = i64; |
| 516 | 525 | |
| 517 | 526 | /// Renamed to Stat to not conflict with the stat function. |
| 518 | 527 | /// atime, mtime, and ctime have functions to return `timespec`, |
| ... | ... | @@ -521,22 +530,22 @@ pub const off_t = i64; |
| 521 | 530 | /// in C, macros are used to hide the differences. Here we use |
| 522 | 531 | /// methods to accomplish this. |
| 523 | 532 | pub const Stat = extern struct { |
| 524 | | dev: u64, |
| 533 | dev: dev_t, |
| 525 | 534 | __dev_padding: u32, |
| 526 | 535 | __ino_truncated: u32, |
| 527 | | mode: u32, |
| 528 | | nlink: u32, |
| 529 | | uid: u32, |
| 530 | | gid: u32, |
| 531 | | rdev: u64, |
| 536 | mode: mode_t, |
| 537 | nlink: nlink_t, |
| 538 | uid: uid_t, |
| 539 | gid: gid_t, |
| 540 | rdev: dev_t, |
| 532 | 541 | __rdev_padding: u32, |
| 533 | 542 | size: off_t, |
| 534 | | blksize: i32, |
| 535 | | blocks: u64, |
| 543 | blksize: blksize_t, |
| 544 | blocks: blkcnt_t, |
| 536 | 545 | atim: timespec, |
| 537 | 546 | mtim: timespec, |
| 538 | 547 | ctim: timespec, |
| 539 | | ino: u64, |
| 548 | ino: ino_t, |
| 540 | 549 | |
| 541 | 550 | pub fn atime(self: Stat) timespec { |
| 542 | 551 | return self.atim; |