mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 07:03:11 +00:00
std.os.linux: Define the Stat struct for riscv32.
The kernel does define the struct, it just doesn't use it. Yet both glibc and musl expose it directly as their public stat struct, and std.c takes it from std.os.linux. So just define it after all.
This commit is contained in:
parent
e084c46ed6
commit
537cb49eb2
@ -212,8 +212,37 @@ pub const msghdr_const = extern struct {
|
||||
flags: i32,
|
||||
};
|
||||
|
||||
/// No `Stat` structure on this platform, only `Statx`.
|
||||
pub const Stat = void;
|
||||
// The `stat` definition used by the Linux kernel.
|
||||
pub const Stat = extern struct {
|
||||
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: blksize_t,
|
||||
__pad2: i32,
|
||||
blocks: blkcnt_t,
|
||||
atim: timespec,
|
||||
mtim: timespec,
|
||||
ctim: timespec,
|
||||
__unused: [2]u32,
|
||||
|
||||
pub fn atime(self: @This()) timespec {
|
||||
return self.atim;
|
||||
}
|
||||
|
||||
pub fn mtime(self: @This()) timespec {
|
||||
return self.mtim;
|
||||
}
|
||||
|
||||
pub fn ctime(self: @This()) timespec {
|
||||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user