I observed open() return EBUSY on linux

when trying to open for writing a tty fd that is already opened with
screen
master
Andrew Kelley 2018-12-21 19:50:21 -05:00
parent 56fedbb524
commit 0eba5b6744
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 6 additions and 0 deletions

View File

@ -459,6 +459,7 @@ pub const PosixOpenError = error{
NoSpaceLeft,
NotDir,
PathAlreadyExists,
DeviceBusy,
/// See https://github.com/ziglang/zig/issues/1396
Unexpected,
@ -497,6 +498,7 @@ pub fn posixOpenC(file_path: [*]const u8, flags: u32, perm: usize) !i32 {
posix.ENOTDIR => return PosixOpenError.NotDir,
posix.EPERM => return PosixOpenError.AccessDenied,
posix.EEXIST => return PosixOpenError.PathAlreadyExists,
posix.EBUSY => return PosixOpenError.DeviceBusy,
else => return unexpectedErrorPosix(err),
}
}
@ -1402,6 +1404,7 @@ const DeleteTreeError = error{
FileSystem,
FileBusy,
DirNotEmpty,
DeviceBusy,
/// On Windows, file paths must be valid Unicode.
InvalidUtf8,
@ -1463,6 +1466,7 @@ pub fn deleteTree(allocator: *Allocator, full_path: []const u8) DeleteTreeError!
error.Unexpected,
error.InvalidUtf8,
error.BadPathName,
error.DeviceBusy,
=> return err,
};
defer dir.close();
@ -1545,6 +1549,7 @@ pub const Dir = struct {
OutOfMemory,
InvalidUtf8,
BadPathName,
DeviceBusy,
/// See https://github.com/ziglang/zig/issues/1396
Unexpected,

View File

@ -1093,6 +1093,7 @@ pub const RealError = error{
NoSpaceLeft,
FileSystem,
BadPathName,
DeviceBusy,
/// On Windows, file paths must be valid Unicode.
InvalidUtf8,