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