Skip to content

Commit b0dcde4

Browse files
committed
IoUring: fix and remove TODOs
fix At build error backout from updating `pipe2` syscall to use Pipe2 flags Review if useful to implement - openat2*, f/madvice64 Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
1 parent fb3c91e commit b0dcde4

File tree

4 files changed

+13
-88
lines changed

4 files changed

+13
-88
lines changed

lib/std/fs.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub fn cwd() Dir {
224224
} else if (native_os == .wasi) {
225225
return .{ .fd = std.options.wasiCwd() };
226226
} else {
227-
return .{ .fd = posix.AT.fdcwd };
227+
return .{ .fd = posix.AT.FDCWD };
228228
}
229229
}
230230

lib/std/os/linux.zig

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ pub fn rmdir(path: [*:0]const u8) usize {
12551255
if (@hasField(SYS, "rmdir")) {
12561256
return syscall1(.rmdir, @intFromPtr(path));
12571257
} else {
1258-
return syscall3(.unlinkat, @as(usize, @bitCast(@as(isize, At.fdcwd))), @intFromPtr(path), @as(u32, @bitCast(At{ .removedir_or_handle_fid = .{ .removedir = true } })));
1258+
return syscall3(.unlinkat, @as(usize, @bitCast(@as(isize, At.fdcwd))), @intFromPtr(path), @as(u32, @bitCast(At{ .removedir = true })));
12591259
}
12601260
}
12611261

@@ -1335,7 +1335,7 @@ pub fn pipe(fd: *[2]i32) usize {
13351335
}
13361336
}
13371337

1338-
pub fn pipe2(fd: *[2]i32, flags: Pipe2) usize {
1338+
pub fn pipe2(fd: *[2]i32, flags: O) usize {
13391339
return syscall2(.pipe2, @intFromPtr(fd), @as(u32, @bitCast(flags)));
13401340
}
13411341

@@ -3793,7 +3793,6 @@ pub const Futex2 = struct {
37933793
};
37943794

37953795
/// flags for `futex2_wait` syscall
3796-
// COMMIT: add mpol and fix private field as its 128 not 32
37973796
pub const Wait = packed struct(u32) {
37983797
size: Size,
37993798
numa: bool = false,
@@ -4511,7 +4510,6 @@ pub const Af = enum(u16) {
45114510
pub const MAX: u16 = @intFromEnum(Af.max);
45124511
};
45134512

4514-
// COMMIT: add new Typed So enum
45154513
/// SO_* type
45164514
pub const So = if (is_mips) enum(u16) {
45174515
debug = 1,
@@ -4803,7 +4801,6 @@ pub const So = if (is_mips) enum(u16) {
48034801
pub const detach_bpf: So = .detach_filter;
48044802
};
48054803

4806-
// COMMIT: add SO constants
48074804
/// Backwards-compatible SO_* constants
48084805
pub const SO = struct {
48094806
pub const DEBUG: u16 = @intFromEnum(So.debug);
@@ -5453,7 +5450,6 @@ pub const Msg = packed struct(u32) {
54535450
/// sendpage() internal: page may carry plain text and require encryption
54545451
sendpage_decrypted: bool = false,
54555452
_22: u4 = 0,
5456-
// COMMIT: new flags
54575453
/// Receive devmem skbs as cmsg
54585454
sock_devmem: bool = false,
54595455
/// Use user data in kernel path
@@ -6069,7 +6065,6 @@ pub const Epoll = if (is_mips) packed struct(u32) {
60696065
rdnorm: bool = false,
60706066
/// Priority data may be read
60716067
rdband: bool = false,
6072-
// COMMIT: new flags
60736068
/// Writing is now possible (normal data)
60746069
wrnorm: bool = false,
60756070
/// Priority data may be written
@@ -7057,7 +7052,6 @@ pub const utsname = extern struct {
70577052
};
70587053
pub const HOST_NAME_MAX = 64;
70597054

7060-
// COMMIT: RenameFlags
70617055
pub const Rename = packed struct(u32) {
70627056
/// Don't overwrite target
70637057
noreplace: bool = false,
@@ -7148,7 +7142,6 @@ pub const Statx = extern struct {
71487142

71497143
__pad2: [14]u64,
71507144

7151-
// COMMIT: add new StatxMask fields
71527145
// https://github.com/torvalds/linux/blob/755fa5b4fb36627796af19932a432d343220ec63/include/uapi/linux/stat.h#L203
71537146
/// matches STATX_* in kernel
71547147
pub const Mask = packed struct(u32) {
@@ -7206,7 +7199,6 @@ pub const Statx = extern struct {
72067199
};
72077200
};
72087201

7209-
// COMMIT: Statx as Packed Struct
72107202
// https://github.com/torvalds/linux/blob/755fa5b4fb36627796af19932a432d343220ec63/include/uapi/linux/stat.h#L248
72117203
/// matches STATX_ATTR_* in kernel
72127204
pub const Attr = packed struct(u64) {
@@ -8630,7 +8622,6 @@ pub const rlimit = extern struct {
86308622
/// DEPRECATED alias for Madvise
86318623
pub const MADV = Madvise;
86328624

8633-
// COMMIT: update MADV_* flags and type as enum
86348625
/// advice flags for `madvise`
86358626
/// matches MADV_* in kernel
86368627
pub const Madvise = enum(u32) {

0 commit comments

Comments
 (0)