mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
Explain why POLL_FD_READWRITE is not dangerous at sites of use
This commit is contained in:
parent
1d8844dd56
commit
b01a5c6bb7
@ -804,6 +804,8 @@ pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.Ope
|
||||
}
|
||||
if (native_os == .wasi and !builtin.link_libc) {
|
||||
var base: std.os.wasi.rights_t = .{};
|
||||
// POLL_FD_READWRITE only grants extra rights if the corresponding FD_READ and/or FD_WRITE
|
||||
// is also set.
|
||||
if (flags.isRead()) {
|
||||
base.FD_READ = true;
|
||||
base.FD_TELL = true;
|
||||
@ -984,6 +986,8 @@ pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File
|
||||
.FD_FILESTAT_SET_TIMES = true,
|
||||
.FD_FILESTAT_SET_SIZE = true,
|
||||
.FD_FILESTAT_GET = true,
|
||||
// POLL_FD_READWRITE only grants extra rights if the corresponding FD_READ and/or
|
||||
// FD_WRITE is also set.
|
||||
.POLL_FD_READWRITE = true,
|
||||
}, .{}),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user