mirror of
https://github.com/ziglang/zig.git
synced 2025-02-09 22:20:17 +00:00
std: use O_NOCTTY flag
This commit is contained in:
parent
23a81b4396
commit
129d3e274d
@ -704,6 +704,9 @@ pub const Dir = struct {
|
||||
if (@hasDecl(os, "O_LARGEFILE")) {
|
||||
os_flags |= os.O_LARGEFILE;
|
||||
}
|
||||
if (!flags.allow_ctty) {
|
||||
os_flags |= os.O_NOCTTY;
|
||||
}
|
||||
os_flags |= if (flags.write and flags.read)
|
||||
@as(u32, os.O_RDWR)
|
||||
else if (flags.write)
|
||||
|
@ -101,6 +101,10 @@ pub const File = struct {
|
||||
/// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions
|
||||
/// related to opening the file, reading, writing, and locking.
|
||||
intended_io_mode: io.ModeOverride = io.default_mode,
|
||||
|
||||
/// Set this to allow the opened file to automatically become the
|
||||
/// controlling TTY for the current process.
|
||||
allow_ctty: bool = false,
|
||||
};
|
||||
|
||||
/// TODO https://github.com/ziglang/zig/issues/3802
|
||||
|
Loading…
Reference in New Issue
Block a user