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{...@@ -459,6 +459,7 @@ pub const PosixOpenError = error{
459 NoSpaceLeft,459 NoSpaceLeft,
460 NotDir,460 NotDir,
461 PathAlreadyExists,461 PathAlreadyExists,
462 DeviceBusy,
462463
463 /// See https://github.com/ziglang/zig/issues/1396464 /// See https://github.com/ziglang/zig/issues/1396
464 Unexpected,465 Unexpected,
...@@ -497,6 +498,7 @@ pub fn posixOpenC(file_path: [*]const u8, flags: u32, perm: usize) !i32 {...@@ -497,6 +498,7 @@ pub fn posixOpenC(file_path: [*]const u8, flags: u32, perm: usize) !i32 {
497 posix.ENOTDIR => return PosixOpenError.NotDir,498 posix.ENOTDIR => return PosixOpenError.NotDir,
498 posix.EPERM => return PosixOpenError.AccessDenied,499 posix.EPERM => return PosixOpenError.AccessDenied,
499 posix.EEXIST => return PosixOpenError.PathAlreadyExists,500 posix.EEXIST => return PosixOpenError.PathAlreadyExists,
501 posix.EBUSY => return PosixOpenError.DeviceBusy,
500 else => return unexpectedErrorPosix(err),502 else => return unexpectedErrorPosix(err),
501 }503 }
502 }504 }
...@@ -1402,6 +1404,7 @@ const DeleteTreeError = error{...@@ -1402,6 +1404,7 @@ const DeleteTreeError = error{
1402 FileSystem,1404 FileSystem,
1403 FileBusy,1405 FileBusy,
1404 DirNotEmpty,1406 DirNotEmpty,
1407 DeviceBusy,
14051408
1406 /// On Windows, file paths must be valid Unicode.1409 /// On Windows, file paths must be valid Unicode.
1407 InvalidUtf8,1410 InvalidUtf8,
...@@ -1463,6 +1466,7 @@ pub fn deleteTree(allocator: *Allocator, full_path: []const u8) DeleteTreeError!...@@ -1463,6 +1466,7 @@ pub fn deleteTree(allocator: *Allocator, full_path: []const u8) DeleteTreeError!
1463 error.Unexpected,1466 error.Unexpected,
1464 error.InvalidUtf8,1467 error.InvalidUtf8,
1465 error.BadPathName,1468 error.BadPathName,
1469 error.DeviceBusy,
1466 => return err,1470 => return err,
1467 };1471 };
1468 defer dir.close();1472 defer dir.close();
...@@ -1545,6 +1549,7 @@ pub const Dir = struct {...@@ -1545,6 +1549,7 @@ pub const Dir = struct {
1545 OutOfMemory,1549 OutOfMemory,
1546 InvalidUtf8,1550 InvalidUtf8,
1547 BadPathName,1551 BadPathName,
1552 DeviceBusy,
15481553
1549 /// See https://github.com/ziglang/zig/issues/13961554 /// See https://github.com/ziglang/zig/issues/1396
1550 Unexpected,1555 Unexpected,
std/os/path.zig+1
...@@ -1093,6 +1093,7 @@ pub const RealError = error{...@@ -1093,6 +1093,7 @@ pub const RealError = error{
1093 NoSpaceLeft,1093 NoSpaceLeft,
1094 FileSystem,1094 FileSystem,
1095 BadPathName,1095 BadPathName,
1096 DeviceBusy,
10961097
1097 /// On Windows, file paths must be valid Unicode.1098 /// On Windows, file paths must be valid Unicode.
1098 InvalidUtf8,1099 InvalidUtf8,