mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
macos: getFdPath: handle E.NOSPC
- per darwin-xnu source, fcntl F_GETPATH will return ENOSPC when path exceeds either user-supplied buffer or system MAXPATHLEN - macOS does not document this (and other) possible errno values
This commit is contained in:
parent
e872c72c55
commit
4cdbde55b4
@ -5098,6 +5098,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 {
|
||||
switch (errno(system.fcntl(fd, F.GETPATH, out_buffer))) {
|
||||
.SUCCESS => {},
|
||||
.BADF => return error.FileNotFound,
|
||||
.NOSPC => return error.NameTooLong,
|
||||
// TODO man pages for fcntl on macOS don't really tell you what
|
||||
// errno values to expect when command is F.GETPATH...
|
||||
else => |err| return unexpectedErrno(err),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user