mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
fix struct stat layout linux arm64
This commit is contained in:
+43
-18
@@ -263,26 +263,51 @@ Unix_File_Time :: struct {
|
|||||||
nanoseconds: i64,
|
nanoseconds: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
OS_Stat :: struct {
|
when ODIN_ARCH == .arm64 {
|
||||||
device_id: u64, // ID of device containing file
|
OS_Stat :: struct {
|
||||||
serial: u64, // File serial number
|
device_id: u64, // ID of device containing file
|
||||||
nlink: u64, // Number of hard links
|
serial: u64, // File serial number
|
||||||
mode: u32, // Mode of the file
|
mode: u32, // Mode of the file
|
||||||
uid: u32, // User ID of the file's owner
|
nlink: u32, // Number of hard links
|
||||||
gid: u32, // Group ID of the file's group
|
uid: u32, // User ID of the file's owner
|
||||||
_padding: i32, // 32 bits of padding
|
gid: u32, // Group ID of the file's group
|
||||||
rdev: u64, // Device ID, if device
|
rdev: u64, // Device ID, if device
|
||||||
size: i64, // Size of the file, in bytes
|
_padding: u64,
|
||||||
block_size: i64, // Optimal bllocksize for I/O
|
size: i64, // Size of the file, in bytes
|
||||||
blocks: i64, // Number of 512-byte blocks allocated
|
block_size: i32, // Optimal blocksize for I/O
|
||||||
|
_padding_2: i32,
|
||||||
|
blocks: i64, // Number of 512-byte blocks allocated
|
||||||
|
|
||||||
last_access: Unix_File_Time, // Time of last access
|
last_access: Unix_File_Time, // Time of last access
|
||||||
modified: Unix_File_Time, // Time of last modification
|
modified: Unix_File_Time, // Time of last modification
|
||||||
status_change: Unix_File_Time, // Time of last status change
|
status_change: Unix_File_Time, // Time of last status change
|
||||||
|
|
||||||
_reserve1,
|
_reserve1,
|
||||||
_reserve2,
|
_reserve2: i32,
|
||||||
_reserve3: i64,
|
}
|
||||||
|
#assert(size_of(OS_Stat) == 128)
|
||||||
|
} else {
|
||||||
|
OS_Stat :: struct {
|
||||||
|
device_id: u64, // ID of device containing file
|
||||||
|
serial: u64, // File serial number
|
||||||
|
nlink: u64, // Number of hard links
|
||||||
|
mode: u32, // Mode of the file
|
||||||
|
uid: u32, // User ID of the file's owner
|
||||||
|
gid: u32, // Group ID of the file's group
|
||||||
|
_padding: i32, // 32 bits of padding
|
||||||
|
rdev: u64, // Device ID, if device
|
||||||
|
size: i64, // Size of the file, in bytes
|
||||||
|
block_size: i64, // Optimal bllocksize for I/O
|
||||||
|
blocks: i64, // Number of 512-byte blocks allocated
|
||||||
|
|
||||||
|
last_access: Unix_File_Time, // Time of last access
|
||||||
|
modified: Unix_File_Time, // Time of last modification
|
||||||
|
status_change: Unix_File_Time, // Time of last status change
|
||||||
|
|
||||||
|
_reserve1,
|
||||||
|
_reserve2,
|
||||||
|
_reserve3: i64,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE(laleksic, 2021-01-21): Comment and rename these to match OS_Stat above
|
// NOTE(laleksic, 2021-01-21): Comment and rename these to match OS_Stat above
|
||||||
|
|||||||
Reference in New Issue
Block a user