aboutsummaryrefslogtreecommitdiff
path: root/std/os/bits/linux/arm64.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-09-22 11:10:28 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-09-22 11:22:22 -0400
commit2510edeb71cad68bd133fd1e3dce08f3a74bbdc7 (patch)
tree11e986a494c692a062d05704ae3b453061f5a58b /std/os/bits/linux/arm64.zig
parentdc2463d9a9c67aa495883325ca62b172402ab4db (diff)
downloadzig-2510edeb71cad68bd133fd1e3dce08f3a74bbdc7.tar.gz
zig-2510edeb71cad68bd133fd1e3dce08f3a74bbdc7.zip
fix linux stat struct on aarch64
The ABI was incorrect.
Diffstat (limited to 'std/os/bits/linux/arm64.zig')
-rw-r--r--std/os/bits/linux/arm64.zig40
1 files changed, 24 insertions, 16 deletions
diff --git a/std/os/bits/linux/arm64.zig b/std/os/bits/linux/arm64.zig
index 657424cd6d..692efc0eb3 100644
--- a/std/os/bits/linux/arm64.zig
+++ b/std/os/bits/linux/arm64.zig
@@ -1,11 +1,13 @@
// arm64-specific declarations that are intended to be imported into the POSIX namespace.
// This does include Linux-only APIs.
-const std = @import("../../std.zig");
+const std = @import("../../../std.zig");
const linux = std.os.linux;
const socklen_t = linux.socklen_t;
const iovec = linux.iovec;
const iovec_const = linux.iovec_const;
+const uid_t = linux.uid_t;
+const gid_t = linux.gid_t;
pub const SYS_io_setup = 0;
pub const SYS_io_destroy = 1;
@@ -382,7 +384,14 @@ pub const msghdr_const = extern struct {
msg_flags: i32,
};
-pub const off_t = i64;
+pub const blksize_t = i32;
+pub const nlink_t = u32;
+pub const time_t = isize;
+pub const mode_t = u32;
+pub const off_t = isize;
+pub const ino_t = usize;
+pub const dev_t = usize;
+pub const blkcnt_t = isize;
/// Renamed to Stat to not conflict with the stat function.
/// atime, mtime, and ctime have functions to return `timespec`,
@@ -391,23 +400,22 @@ pub const off_t = i64;
/// in C, macros are used to hide the differences. Here we use
/// methods to accomplish this.
pub const Stat = extern struct {
- dev: u64,
- ino: u64,
- nlink: usize,
-
- mode: u32,
- uid: u32,
- gid: u32,
- __pad0: u32,
- rdev: u64,
+ dev: dev_t,
+ ino: ino_t,
+ mode: mode_t,
+ nlink: nlink_t,
+ uid: uid_t,
+ gid: gid_t,
+ rdev: dev_t,
+ __pad: usize,
size: off_t,
- blksize: isize,
- blocks: i64,
-
+ blksize: blksize_t,
+ __pad2: i32,
+ blocks: blkcnt_t,
atim: timespec,
mtim: timespec,
ctim: timespec,
- __unused: [3]isize,
+ __unused: [2]u32,
pub fn atime(self: Stat) timespec {
return self.atim;
@@ -423,7 +431,7 @@ pub const Stat = extern struct {
};
pub const timespec = extern struct {
- tv_sec: isize,
+ tv_sec: time_t,
tv_nsec: isize,
};