| author | |
| committer | |
| log | ea38009f3d0476867d945c3f14f5053206ec87f9 |
| tree | 48d7dd0b195ed78e20b020a40c3819c698fa011e |
| parent | ed9a502dffa8db45ef2f73edcbd20c52e26c548f |
2 files changed, 47 insertions(+), 25 deletions(-)
lib/std/os/linux/mips.zig+24-13| ... | ... | @@ -322,7 +322,7 @@ pub const msghdr_const = extern struct { |
| 322 | 322 | flags: i32, |
| 323 | 323 | }; |
| 324 | 324 | |
| 325 | pub const blksize_t = i32; | |
| 325 | pub const blksize_t = u32; | |
| 326 | 326 | pub const nlink_t = u32; |
| 327 | 327 | pub const time_t = i32; |
| 328 | 328 | pub const mode_t = u32; |
| ... | ... | @@ -331,36 +331,47 @@ pub const ino_t = u64; |
| 331 | 331 | pub const dev_t = u64; |
| 332 | 332 | pub const blkcnt_t = i64; |
| 333 | 333 | |
| 334 | // The `stat` definition used by the Linux kernel. | |
| 334 | // The `stat64` definition used by the Linux kernel. | |
| 335 | 335 | pub const Stat = extern struct { |
| 336 | dev: u32, | |
| 337 | __pad0: [3]u32, // Reserved for st_dev expansion | |
| 336 | dev: dev_t, | |
| 337 | __pad0: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 338 | 338 | ino: ino_t, |
| 339 | 339 | mode: mode_t, |
| 340 | 340 | nlink: nlink_t, |
| 341 | 341 | uid: uid_t, |
| 342 | 342 | gid: gid_t, |
| 343 | rdev: u32, | |
| 344 | __pad1: [3]u32, | |
| 343 | rdev: dev_t, | |
| 344 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 345 | 345 | size: off_t, |
| 346 | atim: timespec, | |
| 347 | mtim: timespec, | |
| 348 | ctim: timespec, | |
| 346 | atim: i32, | |
| 347 | atim_nsec: u32, | |
| 348 | mtim: i32, | |
| 349 | mtim_nsec: u32, | |
| 350 | ctim: i32, | |
| 351 | ctim_nsec: u32, | |
| 349 | 352 | blksize: blksize_t, |
| 350 | 353 | __pad3: u32, |
| 351 | 354 | blocks: blkcnt_t, |
| 352 | __pad4: [14]usize, | |
| 353 | 355 | |
| 354 | 356 | pub fn atime(self: @This()) timespec { |
| 355 | return self.atim; | |
| 357 | return .{ | |
| 358 | .sec = self.atim, | |
| 359 | .nsec = self.atim_nsec, | |
| 360 | }; | |
| 356 | 361 | } |
| 357 | 362 | |
| 358 | 363 | pub fn mtime(self: @This()) timespec { |
| 359 | return self.mtim; | |
| 364 | return .{ | |
| 365 | .sec = self.mtim, | |
| 366 | .nsec = self.mtim_nsec, | |
| 367 | }; | |
| 360 | 368 | } |
| 361 | 369 | |
| 362 | 370 | pub fn ctime(self: @This()) timespec { |
| 363 | return self.ctim; | |
| 371 | return .{ | |
| 372 | .sec = self.ctim, | |
| 373 | .nsec = self.ctim_nsec, | |
| 374 | }; | |
| 364 | 375 | } |
| 365 | 376 | }; |
| 366 | 377 |
lib/std/os/linux/mips64.zig+23-12| ... | ... | @@ -301,7 +301,7 @@ pub const msghdr_const = extern struct { |
| 301 | 301 | flags: i32, |
| 302 | 302 | }; |
| 303 | 303 | |
| 304 | pub const blksize_t = i32; | |
| 304 | pub const blksize_t = u32; | |
| 305 | 305 | pub const nlink_t = u32; |
| 306 | 306 | pub const time_t = i32; |
| 307 | 307 | pub const mode_t = u32; |
| ... | ... | @@ -312,34 +312,45 @@ pub const blkcnt_t = i64; |
| 312 | 312 | |
| 313 | 313 | // The `stat` definition used by the Linux kernel. |
| 314 | 314 | pub const Stat = extern struct { |
| 315 | dev: u32, | |
| 316 | __pad0: [3]u32, // Reserved for st_dev expansion | |
| 315 | dev: dev_t, | |
| 316 | __pad0: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 317 | 317 | ino: ino_t, |
| 318 | 318 | mode: mode_t, |
| 319 | 319 | nlink: nlink_t, |
| 320 | 320 | uid: uid_t, |
| 321 | 321 | gid: gid_t, |
| 322 | rdev: u32, | |
| 323 | __pad1: [3]u32, | |
| 322 | rdev: dev_t, | |
| 323 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | |
| 324 | 324 | size: off_t, |
| 325 | atim: timespec, | |
| 326 | mtim: timespec, | |
| 327 | ctim: timespec, | |
| 325 | atim: u32, | |
| 326 | atim_nsec: u32, | |
| 327 | mtim: u32, | |
| 328 | mtim_nsec: u32, | |
| 329 | ctim: u32, | |
| 330 | ctim_nsec: u32, | |
| 328 | 331 | blksize: blksize_t, |
| 329 | 332 | __pad3: u32, |
| 330 | 333 | blocks: blkcnt_t, |
| 331 | __pad4: [14]usize, | |
| 332 | 334 | |
| 333 | 335 | pub fn atime(self: @This()) timespec { |
| 334 | return self.atim; | |
| 336 | return .{ | |
| 337 | .sec = self.atim, | |
| 338 | .nsec = self.atim_nsec, | |
| 339 | }; | |
| 335 | 340 | } |
| 336 | 341 | |
| 337 | 342 | pub fn mtime(self: @This()) timespec { |
| 338 | return self.mtim; | |
| 343 | return .{ | |
| 344 | .sec = self.mtim, | |
| 345 | .nsec = self.mtim_nsec, | |
| 346 | }; | |
| 339 | 347 | } |
| 340 | 348 | |
| 341 | 349 | pub fn ctime(self: @This()) timespec { |
| 342 | return self.ctim; | |
| 350 | return .{ | |
| 351 | .sec = self.ctim, | |
| 352 | .nsec = self.ctim_nsec, | |
| 353 | }; | |
| 343 | 354 | } |
| 344 | 355 | }; |
| 345 | 356 |