@@ -869,7 +869,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize {
869
869
.INTR = > continue ,
870
870
.INVAL = > unreachable ,
871
871
.FAULT = > unreachable ,
872
- .NOENT = > return error .ProcessNotFound ,
872
+ .SRCH = > return error .ProcessNotFound ,
873
873
.AGAIN = > return error .WouldBlock ,
874
874
.CANCELED = > return error .Canceled ,
875
875
.BADF = > return error .NotOpenForReading , // Can be a race condition.
@@ -933,7 +933,7 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize {
933
933
.INTR = > continue ,
934
934
.INVAL = > unreachable ,
935
935
.FAULT = > unreachable ,
936
- .NOENT = > return error .ProcessNotFound ,
936
+ .SRCH = > return error .ProcessNotFound ,
937
937
.AGAIN = > return error .WouldBlock ,
938
938
.BADF = > return error .NotOpenForReading , // can be a race condition
939
939
.IO = > return error .InputOutput ,
@@ -1013,7 +1013,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize {
1013
1013
.INTR = > continue ,
1014
1014
.INVAL = > unreachable ,
1015
1015
.FAULT = > unreachable ,
1016
- .NOENT = > return error .ProcessNotFound ,
1016
+ .SRCH = > return error .ProcessNotFound ,
1017
1017
.AGAIN = > return error .WouldBlock ,
1018
1018
.BADF = > return error .NotOpenForReading , // Can be a race condition.
1019
1019
.IO = > return error .InputOutput ,
@@ -1155,7 +1155,7 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize {
1155
1155
.INTR = > continue ,
1156
1156
.INVAL = > unreachable ,
1157
1157
.FAULT = > unreachable ,
1158
- .NOENT = > return error .ProcessNotFound ,
1158
+ .SRCH = > return error .ProcessNotFound ,
1159
1159
.AGAIN = > return error .WouldBlock ,
1160
1160
.BADF = > return error .NotOpenForReading , // can be a race condition
1161
1161
.IO = > return error .InputOutput ,
@@ -1277,7 +1277,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {
1277
1277
.INTR = > continue ,
1278
1278
.INVAL = > return error .InvalidArgument ,
1279
1279
.FAULT = > unreachable ,
1280
- .NOENT = > return error .ProcessNotFound ,
1280
+ .SRCH = > return error .ProcessNotFound ,
1281
1281
.AGAIN = > return error .WouldBlock ,
1282
1282
.BADF = > return error .NotOpenForWriting , // can be a race condition.
1283
1283
.DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1353,7 +1353,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize {
1353
1353
.INTR = > continue ,
1354
1354
.INVAL = > return error .InvalidArgument ,
1355
1355
.FAULT = > unreachable ,
1356
- .NOENT = > return error .ProcessNotFound ,
1356
+ .SRCH = > return error .ProcessNotFound ,
1357
1357
.AGAIN = > return error .WouldBlock ,
1358
1358
.BADF = > return error .NotOpenForWriting , // Can be a race condition.
1359
1359
.DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1443,7 +1443,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize {
1443
1443
.INTR = > continue ,
1444
1444
.INVAL = > return error .InvalidArgument ,
1445
1445
.FAULT = > unreachable ,
1446
- .NOENT = > return error .ProcessNotFound ,
1446
+ .SRCH = > return error .ProcessNotFound ,
1447
1447
.AGAIN = > return error .WouldBlock ,
1448
1448
.BADF = > return error .NotOpenForWriting , // Can be a race condition.
1449
1449
.DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1528,7 +1528,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz
1528
1528
.INTR = > continue ,
1529
1529
.INVAL = > return error .InvalidArgument ,
1530
1530
.FAULT = > unreachable ,
1531
- .NOENT = > return error .ProcessNotFound ,
1531
+ .SRCH = > return error .ProcessNotFound ,
1532
1532
.AGAIN = > return error .WouldBlock ,
1533
1533
.BADF = > return error .NotOpenForWriting , // Can be a race condition.
1534
1534
.DESTADDRREQ = > unreachable , // `connect` was never called.
@@ -1607,6 +1607,9 @@ pub const OpenError = error{
1607
1607
/// On Windows, `\\server` or `\\server\share` was not found.
1608
1608
NetworkNotFound ,
1609
1609
1610
+ /// This error occurs in Linux if the process to be open was not found.
1611
+ ProcessNotFound ,
1612
+
1610
1613
/// One of these three things:
1611
1614
/// * pathname refers to an executable image which is currently being
1612
1615
/// 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 {
1666
1669
.NFILE = > return error .SystemFdQuotaExceeded ,
1667
1670
.NODEV = > return error .NoDevice ,
1668
1671
.NOENT = > return error .FileNotFound ,
1672
+ .SRCH = > return error .ProcessNotFound ,
1669
1673
.NOMEM = > return error .SystemResources ,
1670
1674
.NOSPC = > return error .NoSpaceLeft ,
1671
1675
.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
1837
1841
.NFILE = > return error .SystemFdQuotaExceeded ,
1838
1842
.NODEV = > return error .NoDevice ,
1839
1843
.NOENT = > return error .FileNotFound ,
1844
+ .SRCH = > return error .ProcessNotFound ,
1840
1845
.NOMEM = > return error .SystemResources ,
1841
1846
.NOSPC = > return error .NoSpaceLeft ,
1842
1847
.NOTDIR = > return error .NotDir ,
@@ -5483,6 +5488,7 @@ pub const RealPathError = error{
5483
5488
FileSystem ,
5484
5489
BadPathName ,
5485
5490
DeviceBusy ,
5491
+ ProcessNotFound ,
5486
5492
5487
5493
SharingViolation ,
5488
5494
PipeBusy ,
0 commit comments