| author | |
| committer | |
| log | 129d3e274dbc3e11a30e3d54c5da7a944ddcf4f0 |
| tree | 386d6b361b9fb75ebb8d09f0e4aeb817cb6aa38c |
| parent | 23a81b439638fee89054ad749f0348ab7d107619 |
| signature |
2 files changed, 7 insertions(+), 0 deletions(-)
lib/std/fs.zig+3| ... | ... | @@ -704,6 +704,9 @@ pub const Dir = struct { |
| 704 | 704 | if (@hasDecl(os, "O_LARGEFILE")) { |
| 705 | 705 | os_flags |= os.O_LARGEFILE; |
| 706 | 706 | } |
| 707 | if (!flags.allow_ctty) { | |
| 708 | os_flags |= os.O_NOCTTY; | |
| 709 | } | |
| 707 | 710 | os_flags |= if (flags.write and flags.read) |
| 708 | 711 | @as(u32, os.O_RDWR) |
| 709 | 712 | else if (flags.write) |
lib/std/fs/file.zig+4| ... | ... | @@ -101,6 +101,10 @@ pub const File = struct { |
| 101 | 101 | /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions |
| 102 | 102 | /// related to opening the file, reading, writing, and locking. |
| 103 | 103 | intended_io_mode: io.ModeOverride = io.default_mode, |
| 104 | ||
| 105 | /// Set this to allow the opened file to automatically become the | |
| 106 | /// controlling TTY for the current process. | |
| 107 | allow_ctty: bool = false, | |
| 104 | 108 | }; |
| 105 | 109 | |
| 106 | 110 | /// TODO https://github.com/ziglang/zig/issues/3802 |