@@ -869,7 +869,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize {
869869 .INTR = > continue ,
870870 .INVAL = > unreachable ,
871871 .FAULT = > unreachable ,
872- .NOENT = > return error .ProcessNotFound ,
872+ .SRCH = > return error .ProcessNotFound ,
873873 .AGAIN = > return error .WouldBlock ,
874874 .CANCELED = > return error .Canceled ,
875875 .BADF = > return error .NotOpenForReading , // Can be a race condition.
@@ -933,7 +933,7 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize {
933933 .INTR = > continue ,
934934 .INVAL = > unreachable ,
935935 .FAULT = > unreachable ,
936- .NOENT = > return error .ProcessNotFound ,
936+ .SRCH = > return error .ProcessNotFound ,
937937 .AGAIN = > return error .WouldBlock ,
938938 .BADF = > return error .NotOpenForReading , // can be a race condition
939939 .IO = > return error .InputOutput ,
@@ -1013,7 +1013,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize {
10131013 .INTR = > continue ,
10141014 .INVAL = > unreachable ,
10151015 .FAULT = > unreachable ,
1016- .NOENT = > return error .ProcessNotFound ,
1016+ .SRCH = > return error .ProcessNotFound ,
10171017 .AGAIN = > return error .WouldBlock ,
10181018 .BADF = > return error .NotOpenForReading , // Can be a race condition.
10191019 .IO = > return error .InputOutput ,
@@ -1155,7 +1155,7 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize {
11551155 .INTR = > continue ,
11561156 .INVAL = > unreachable ,
11571157 .FAULT = > unreachable ,
1158- .NOENT = > return error .ProcessNotFound ,
1158+ .SRCH = > return error .ProcessNotFound ,
11591159 .AGAIN = > return error .WouldBlock ,
11601160 .BADF = > return error .NotOpenForReading , // can be a race condition
11611161 .IO = > return error .InputOutput ,
@@ -1277,7 +1277,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {
12771277 .INTR = > continue ,
12781278 .INVAL = > return error .InvalidArgument ,
12791279 .FAULT = > unreachable ,
1280- .NOENT = > return error .ProcessNotFound ,
1280+ .SRCH = > return error .ProcessNotFound ,
12811281 .AGAIN = > return error .WouldBlock ,
12821282 .BADF = > return error .NotOpenForWriting , // can be a race condition.
12831283 .DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1353,7 +1353,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize {
13531353 .INTR = > continue ,
13541354 .INVAL = > return error .InvalidArgument ,
13551355 .FAULT = > unreachable ,
1356- .NOENT = > return error .ProcessNotFound ,
1356+ .SRCH = > return error .ProcessNotFound ,
13571357 .AGAIN = > return error .WouldBlock ,
13581358 .BADF = > return error .NotOpenForWriting , // Can be a race condition.
13591359 .DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1443,7 +1443,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize {
14431443 .INTR = > continue ,
14441444 .INVAL = > return error .InvalidArgument ,
14451445 .FAULT = > unreachable ,
1446- .NOENT = > return error .ProcessNotFound ,
1446+ .SRCH = > return error .ProcessNotFound ,
14471447 .AGAIN = > return error .WouldBlock ,
14481448 .BADF = > return error .NotOpenForWriting , // Can be a race condition.
14491449 .DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1528,7 +1528,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz
15281528 .INTR = > continue ,
15291529 .INVAL = > return error .InvalidArgument ,
15301530 .FAULT = > unreachable ,
1531- .NOENT = > return error .ProcessNotFound ,
1531+ .SRCH = > return error .ProcessNotFound ,
15321532 .AGAIN = > return error .WouldBlock ,
15331533 .BADF = > return error .NotOpenForWriting , // Can be a race condition.
15341534 .DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1607,6 +1607,9 @@ pub const OpenError = error{
16071607 /// On Windows, `\\server` or `\\server\share` was not found.
16081608 NetworkNotFound ,
16091609
1610+ /// This error occurs in Linux if the process to be open was not found.
1611+ ProcessNotFound ,
1612+
16101613 /// One of these three things:
16111614 /// * pathname refers to an executable image which is currently being
16121615 /// executed and write access was requested.
@@ -1666,6 +1669,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: O, perm: mode_t) OpenError!fd_t {
16661669 .NFILE = > return error .SystemFdQuotaExceeded ,
16671670 .NODEV = > return error .NoDevice ,
16681671 .NOENT = > return error .FileNotFound ,
1672+ .SRCH = > return error .ProcessNotFound ,
16691673 .NOMEM = > return error .SystemResources ,
16701674 .NOSPC = > return error .NoSpaceLeft ,
16711675 .NOTDIR = > return error .NotDir ,
@@ -1837,6 +1841,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: O, mode: mode_t) O
18371841 .NFILE = > return error .SystemFdQuotaExceeded ,
18381842 .NODEV = > return error .NoDevice ,
18391843 .NOENT = > return error .FileNotFound ,
1844+ .SRCH = > return error .ProcessNotFound ,
18401845 .NOMEM = > return error .SystemResources ,
18411846 .NOSPC = > return error .NoSpaceLeft ,
18421847 .NOTDIR = > return error .NotDir ,
@@ -5483,6 +5488,7 @@ pub const RealPathError = error{
54835488 FileSystem ,
54845489 BadPathName ,
54855490 DeviceBusy ,
5491+ ProcessNotFound ,
54865492
54875493 SharingViolation ,
54885494 PipeBusy ,
0 commit comments