| ... | ... | @@ -594,7 +594,7 @@ const CachedFd = struct { |
| 594 | 594 | futexWake(ev, @ptrCast(&cached_fd.once), 1); |
| 595 | 595 | } |
| 596 | 596 | const fd = ev.openat(cancel_region, linux.AT.FDCWD, path, flags, 0) catch |err| switch (err) { |
| 597 | | error.OperationUnsupported => return error.Unexpected, // Not expecting O_TMPFILE flag |
| 597 | error.OperationUnsupported => return error.Unexpected, // TMPFILE unset. |
| 598 | 598 | else => |e| return e, |
| 599 | 599 | }; |
| 600 | 600 | @atomicStore(Once, &cached_fd.once, .fromFd(fd), .monotonic); |
| ... | ... | @@ -2725,11 +2725,10 @@ fn dirOpenDir( |
| 2725 | 2725 | error.WouldBlock => return errnoBug(.AGAIN), |
| 2726 | 2726 | error.FileTooBig => return errnoBug(.FBIG), |
| 2727 | 2727 | error.NoSpaceLeft => return errnoBug(.NOSPC), |
| 2728 | | error.DeviceBusy => return errnoBug(.BUSY), // O_EXCL not passed |
| 2728 | error.DeviceBusy => return errnoBug(.BUSY), // EXCL unset. |
| 2729 | 2729 | error.FileBusy => return errnoBug(.TXTBSY), |
| 2730 | 2730 | error.PathAlreadyExists => return errnoBug(.EXIST), // Not creating. |
| 2731 | | error.FileLocksUnsupported => return errnoBug(.OPNOTSUPP), // Not asking for locks. |
| 2732 | | error.OperationUnsupported => return errnoBug(.OPNOTSUPP), // Not asking for O_TMPFILE. |
| 2731 | error.OperationUnsupported => return errnoBug(.OPNOTSUPP), // No TMPFILE, no locks. |
| 2733 | 2732 | else => |e| return e, |
| 2734 | 2733 | }, |
| 2735 | 2734 | }; |
| ... | ... | @@ -2819,7 +2818,7 @@ fn dirCreateFile( |
| 2819 | 2818 | .EXCL = flags.exclusive, |
| 2820 | 2819 | .CLOEXEC = true, |
| 2821 | 2820 | }, flags.permissions.toMode()) catch |err| switch (err) { |
| 2822 | | error.OperationUnsupported => return error.Unexpected, // TMPFILE bit not set. |
| 2821 | error.OperationUnsupported => return error.Unexpected, // TMPFILE unset. |
| 2823 | 2822 | else => |e| return e, |
| 2824 | 2823 | }; |
| 2825 | 2824 | errdefer ev.closeAsync(fd); |
| ... | ... | @@ -2906,7 +2905,6 @@ fn dirCreateFileAtomic( |
| 2906 | 2905 | error.FileTooBig => return errnoBug(.FBIG), |
| 2907 | 2906 | error.DeviceBusy => return errnoBug(.BUSY), // O_EXCL not passed |
| 2908 | 2907 | error.PathAlreadyExists => return errnoBug(.EXIST), // Not creating. |
| 2909 | | error.FileLocksUnsupported => return errnoBug(.OPNOTSUPP), // Not asking for locks. |
| 2910 | 2908 | else => |e| return e, |
| 2911 | 2909 | }, |
| 2912 | 2910 | .flags = .{ .nonblocking = false }, |
| ... | ... | @@ -3008,7 +3006,7 @@ fn dirOpenFile( |
| 3008 | 3006 | .CLOEXEC = true, |
| 3009 | 3007 | .PATH = flags.path_only, |
| 3010 | 3008 | }, 0) catch |err| switch (err) { |
| 3011 | | error.OperationUnsupported => return error.Unexpected, // TMPFILE bit not set. |
| 3009 | error.OperationUnsupported => return error.Unexpected, // TMPFILE unset. |
| 3012 | 3010 | else => |e| return e, |
| 3013 | 3011 | }; |
| 3014 | 3012 | errdefer ev.closeAsync(fd); |
| ... | ... | @@ -3155,7 +3153,7 @@ fn dirRealPathFile( |
| 3155 | 3153 | .PATH = true, |
| 3156 | 3154 | }, 0) catch |err| switch (err) { |
| 3157 | 3155 | error.WouldBlock => return errnoBug(.AGAIN), |
| 3158 | | error.FileLocksUnsupported => return errnoBug(.OPNOTSUPP), // Not asking for locks. |
| 3156 | error.OperationUnsupported => return errnoBug(.OPNOTSUPP), // Not asking for locks. |
| 3159 | 3157 | else => |e| return e, |
| 3160 | 3158 | }; |
| 3161 | 3159 | defer ev.closeAsync(fd); |
| ... | ... | @@ -5615,27 +5613,6 @@ fn lseek( |
| 5615 | 5613 | } |
| 5616 | 5614 | } |
| 5617 | 5615 | |
| 5618 | | const OpenError = error{ |
| 5619 | | AccessDenied, |
| 5620 | | FileTooBig, |
| 5621 | | IsDir, |
| 5622 | | SymLinkLoop, |
| 5623 | | ProcessFdQuotaExceeded, |
| 5624 | | SystemFdQuotaExceeded, |
| 5625 | | NoDevice, |
| 5626 | | FileNotFound, |
| 5627 | | SystemResources, |
| 5628 | | NoSpaceLeft, |
| 5629 | | NotDir, |
| 5630 | | PermissionDenied, |
| 5631 | | PathAlreadyExists, |
| 5632 | | DeviceBusy, |
| 5633 | | OperationUnsupported, |
| 5634 | | FileLocksUnsupported, |
| 5635 | | WouldBlock, |
| 5636 | | FileBusy, |
| 5637 | | } || Dir.PathNameError || Io.Cancelable || Io.UnexpectedError; |
| 5638 | | |
| 5639 | 5616 | fn openat( |
| 5640 | 5617 | ev: *Evented, |
| 5641 | 5618 | cancel_region: *CancelRegion, |
| ... | ... | @@ -5643,7 +5620,7 @@ fn openat( |
| 5643 | 5620 | path: [*:0]const u8, |
| 5644 | 5621 | flags: linux.O, |
| 5645 | 5622 | mode: linux.mode_t, |
| 5646 | | ) OpenError!fd_t { |
| 5623 | ) !fd_t { |
| 5647 | 5624 | var mut_flags = flags; |
| 5648 | 5625 | if (@hasField(linux.O, "LARGEFILE")) mut_flags.LARGEFILE = true; |
| 5649 | 5626 | while (true) { |
| ... | ... | @@ -5689,8 +5666,9 @@ fn openat( |
| 5689 | 5666 | .PERM => return error.PermissionDenied, |
| 5690 | 5667 | .EXIST => return error.PathAlreadyExists, |
| 5691 | 5668 | .BUSY => return error.DeviceBusy, |
| 5692 | | // File locking and TMPFILE are mutually exclusive |
| 5693 | | .OPNOTSUPP => return if (flags.TMPFILE) error.OperationUnsupported else error.FileLocksUnsupported, |
| 5669 | // This can be triggered by file locking and TMPFILE, but those |
| 5670 | // flags are mutually exclusive. |
| 5671 | .OPNOTSUPP => return error.OperationUnsupported, |
| 5694 | 5672 | .AGAIN => return error.WouldBlock, |
| 5695 | 5673 | .TXTBSY => return error.FileBusy, |
| 5696 | 5674 | .NXIO => return error.NoDevice, |