| ... | @@ -1,11 +1,13 @@ | ... | @@ -1,11 +1,13 @@ |
| 1 | // arm64-specific declarations that are intended to be imported into the POSIX namespace. | 1 | // arm64-specific declarations that are intended to be imported into the POSIX namespace. |
| 2 | // This does include Linux-only APIs. | 2 | // This does include Linux-only APIs. |
| 3 | | 3 | |
| 4 | const std = @import("../../std.zig"); | 4 | const std = @import("../../../std.zig"); |
| 5 | const linux = std.os.linux; | 5 | const linux = std.os.linux; |
| 6 | const socklen_t = linux.socklen_t; | 6 | const socklen_t = linux.socklen_t; |
| 7 | const iovec = linux.iovec; | 7 | const iovec = linux.iovec; |
| 8 | const iovec_const = linux.iovec_const; | 8 | const iovec_const = linux.iovec_const; |
| | 9 | const uid_t = linux.uid_t; |
| | 10 | const gid_t = linux.gid_t; |
| 9 | | 11 | |
| 10 | pub const SYS_io_setup = 0; | 12 | pub const SYS_io_setup = 0; |
| 11 | pub const SYS_io_destroy = 1; | 13 | pub const SYS_io_destroy = 1; |
| ... | @@ -382,7 +384,14 @@ pub const msghdr_const = extern struct { | ... | @@ -382,7 +384,14 @@ pub const msghdr_const = extern struct { |
| 382 | msg_flags: i32, | 384 | msg_flags: i32, |
| 383 | }; | 385 | }; |
| 384 | | 386 | |
| 385 | pub const off_t = i64; | 387 | pub const blksize_t = i32; |
| | 388 | pub const nlink_t = u32; |
| | 389 | pub const time_t = isize; |
| | 390 | pub const mode_t = u32; |
| | 391 | pub const off_t = isize; |
| | 392 | pub const ino_t = usize; |
| | 393 | pub const dev_t = usize; |
| | 394 | pub const blkcnt_t = isize; |
| 386 | | 395 | |
| 387 | /// Renamed to Stat to not conflict with the stat function. | 396 | /// Renamed to Stat to not conflict with the stat function. |
| 388 | /// atime, mtime, and ctime have functions to return `timespec`, | 397 | /// atime, mtime, and ctime have functions to return `timespec`, |
| ... | @@ -391,23 +400,22 @@ pub const off_t = i64; | ... | @@ -391,23 +400,22 @@ pub const off_t = i64; |
| 391 | /// in C, macros are used to hide the differences. Here we use | 400 | /// in C, macros are used to hide the differences. Here we use |
| 392 | /// methods to accomplish this. | 401 | /// methods to accomplish this. |
| 393 | pub const Stat = extern struct { | 402 | pub const Stat = extern struct { |
| 394 | dev: u64, | 403 | dev: dev_t, |
| 395 | ino: u64, | 404 | ino: ino_t, |
| 396 | nlink: usize, | 405 | mode: mode_t, |
| 397 | | 406 | nlink: nlink_t, |
| 398 | mode: u32, | 407 | uid: uid_t, |
| 399 | uid: u32, | 408 | gid: gid_t, |
| 400 | gid: u32, | 409 | rdev: dev_t, |
| 401 | __pad0: u32, | 410 | __pad: usize, |
| 402 | rdev: u64, | | |
| 403 | size: off_t, | 411 | size: off_t, |
| 404 | blksize: isize, | 412 | blksize: blksize_t, |
| 405 | blocks: i64, | 413 | __pad2: i32, |
| 406 | | 414 | blocks: blkcnt_t, |
| 407 | atim: timespec, | 415 | atim: timespec, |
| 408 | mtim: timespec, | 416 | mtim: timespec, |
| 409 | ctim: timespec, | 417 | ctim: timespec, |
| 410 | __unused: [3]isize, | 418 | __unused: [2]u32, |
| 411 | | 419 | |
| 412 | pub fn atime(self: Stat) timespec { | 420 | pub fn atime(self: Stat) timespec { |
| 413 | return self.atim; | 421 | return self.atim; |
| ... | @@ -423,7 +431,7 @@ pub const Stat = extern struct { | ... | @@ -423,7 +431,7 @@ pub const Stat = extern struct { |
| 423 | }; | 431 | }; |
| 424 | | 432 | |
| 425 | pub const timespec = extern struct { | 433 | pub const timespec = extern struct { |
| 426 | tv_sec: isize, | 434 | tv_sec: time_t, |
| 427 | tv_nsec: isize, | 435 | tv_nsec: isize, |
| 428 | }; | 436 | }; |
| 429 | | 437 | |