1
1
// arm64-specific declarations that are intended to be imported into the POSIX namespace.
2
2
// This does include Linux-only APIs.
3
3
4
- const std = @import ("../../std.zig" );
4
+ const std = @import ("../../../ std.zig" );
5
5
const linux = std .os .linux ;
6
6
const socklen_t = linux .socklen_t ;
7
7
const iovec = linux .iovec ;
8
8
const iovec_const = linux .iovec_const ;
9
+ const uid_t = linux .uid_t ;
10
+ const gid_t = linux .gid_t ;
9
11
10
12
pub const SYS_io_setup = 0 ;
11
13
pub const SYS_io_destroy = 1 ;
@@ -382,7 +384,14 @@ pub const msghdr_const = extern struct {
382
384
msg_flags : i32 ,
383
385
};
384
386
385
- pub const off_t = i64 ;
387
+ pub const blksize_t = i32 ;
388
+ pub const nlink_t = u32 ;
389
+ pub const time_t = isize ;
390
+ pub const mode_t = u32 ;
391
+ pub const off_t = isize ;
392
+ pub const ino_t = usize ;
393
+ pub const dev_t = usize ;
394
+ pub const blkcnt_t = isize ;
386
395
387
396
/// Renamed to Stat to not conflict with the stat function.
388
397
/// atime, mtime, and ctime have functions to return `timespec`,
@@ -391,23 +400,22 @@ pub const off_t = i64;
391
400
/// in C, macros are used to hide the differences. Here we use
392
401
/// methods to accomplish this.
393
402
pub const Stat = extern struct {
394
- dev : u64 ,
395
- ino : u64 ,
396
- nlink : usize ,
397
-
398
- mode : u32 ,
399
- uid : u32 ,
400
- gid : u32 ,
401
- __pad0 : u32 ,
402
- rdev : u64 ,
403
+ dev : dev_t ,
404
+ ino : ino_t ,
405
+ mode : mode_t ,
406
+ nlink : nlink_t ,
407
+ uid : uid_t ,
408
+ gid : gid_t ,
409
+ rdev : dev_t ,
410
+ __pad : usize ,
403
411
size : off_t ,
404
- blksize : isize ,
405
- blocks : i64 ,
406
-
412
+ blksize : blksize_t ,
413
+ __pad2 : i32 ,
414
+ blocks : blkcnt_t ,
407
415
atim : timespec ,
408
416
mtim : timespec ,
409
417
ctim : timespec ,
410
- __unused : [3 ] isize ,
418
+ __unused : [2 ] u32 ,
411
419
412
420
pub fn atime (self : Stat ) timespec {
413
421
return self .atim ;
@@ -423,7 +431,7 @@ pub const Stat = extern struct {
423
431
};
424
432
425
433
pub const timespec = extern struct {
426
- tv_sec : isize ,
434
+ tv_sec : time_t ,
427
435
tv_nsec : isize ,
428
436
};
429
437
0 commit comments