authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-21 19:50:21-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-21 19:50:21-05:00
log0eba5b6744c51892348a7b71726891189b0af7d8
tree78b42277bae42390028561d58e65b6cc7dd897f1
parent56fedbb52423eba6d2088a1e2c8b94e0c4eb85ac
signature Commit is signed but in an unrecognized format.

I observed open() return EBUSY on linux

when trying to open for writing a tty fd that is already opened with screen

2 files changed, 6 insertions(+), 0 deletions(-)

std/os/index.zig+5
......@@ -459,6 +459,7 @@ pub const PosixOpenError = error{
459459 NoSpaceLeft,
460460 NotDir,
461461 PathAlreadyExists,
462 DeviceBusy,
462463
463464 /// See https://github.com/ziglang/zig/issues/1396
464465 Unexpected,
......@@ -497,6 +498,7 @@ pub fn posixOpenC(file_path: [*]const u8, flags: u32, perm: usize) !i32 {
497498 posix.ENOTDIR => return PosixOpenError.NotDir,
498499 posix.EPERM => return PosixOpenError.AccessDenied,
499500 posix.EEXIST => return PosixOpenError.PathAlreadyExists,
501 posix.EBUSY => return PosixOpenError.DeviceBusy,
500502 else => return unexpectedErrorPosix(err),
501503 }
502504 }
......@@ -1402,6 +1404,7 @@ const DeleteTreeError = error{
14021404 FileSystem,
14031405 FileBusy,
14041406 DirNotEmpty,
1407 DeviceBusy,
14051408
14061409 /// On Windows, file paths must be valid Unicode.
14071410 InvalidUtf8,
......@@ -1463,6 +1466,7 @@ pub fn deleteTree(allocator: *Allocator, full_path: []const u8) DeleteTreeError!
14631466 error.Unexpected,
14641467 error.InvalidUtf8,
14651468 error.BadPathName,
1469 error.DeviceBusy,
14661470 => return err,
14671471 };
14681472 defer dir.close();
......@@ -1545,6 +1549,7 @@ pub const Dir = struct {
15451549 OutOfMemory,
15461550 InvalidUtf8,
15471551 BadPathName,
1552 DeviceBusy,
15481553
15491554 /// See https://github.com/ziglang/zig/issues/1396
15501555 Unexpected,
std/os/path.zig+1
......@@ -1093,6 +1093,7 @@ pub const RealError = error{
10931093 NoSpaceLeft,
10941094 FileSystem,
10951095 BadPathName,
1096 DeviceBusy,
10961097
10971098 /// On Windows, file paths must be valid Unicode.
10981099 InvalidUtf8,