aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-11-04 15:55:36 +0100
committerLemonBoy <thatlemon@gmail.com>2020-11-05 09:38:50 +0100
commit0e95fa455c1012fc5d2247600b89e2d60f146ef3 (patch)
tree3df314e8d7983da275ea6d33bf5d58f986106dd2 /lib/std/os/linux.zig
parent346a686b9d6a086d0e5f3b25bd686681eea7052b (diff)
downloadzig-0e95fa455c1012fc5d2247600b89e2d60f146ef3.tar.gz
zig-0e95fa455c1012fc5d2247600b89e2d60f146ef3.zip
std: Split kernel&libc definitions of stat struct
There's no guarantee for the kernel definition to be ABI compatible with the libc one (and vice versa). There's also no guarantee of ABI compatibility between musl/glibc. Fun, isn't it?
Diffstat (limited to 'lib/std/os/linux.zig')
-rw-r--r--lib/std/os/linux.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig
index c5fbd0bcfe..9c6f7d3374 100644
--- a/lib/std/os/linux.zig
+++ b/lib/std/os/linux.zig
@@ -1047,7 +1047,7 @@ pub fn accept4(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t, flag
return syscall4(.accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags);
}
-pub fn fstat(fd: i32, stat_buf: *Stat) usize {
+pub fn fstat(fd: i32, stat_buf: *kernel_stat) usize {
if (@hasField(SYS, "fstat64")) {
return syscall2(.fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));
} else {
@@ -1055,7 +1055,7 @@ pub fn fstat(fd: i32, stat_buf: *Stat) usize {
}
}
-pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize {
+pub fn stat(pathname: [*:0]const u8, statbuf: *kernel_stat) usize {
if (@hasField(SYS, "stat64")) {
return syscall2(.stat64, @ptrToInt(pathname), @ptrToInt(statbuf));
} else {
@@ -1063,7 +1063,7 @@ pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize {
}
}
-pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize {
+pub fn lstat(pathname: [*:0]const u8, statbuf: *kernel_stat) usize {
if (@hasField(SYS, "lstat64")) {
return syscall2(.lstat64, @ptrToInt(pathname), @ptrToInt(statbuf));
} else {
@@ -1071,7 +1071,7 @@ pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize {
}
}
-pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize {
+pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *kernel_stat, flags: u32) usize {
if (@hasField(SYS, "fstatat64")) {
return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
} else {