mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 18:26:13 +03:00
comment on why to not use posix.errno
This commit is contained in:
@ -130,6 +130,7 @@ pub fn cloneInto(cgroup: []const u8) !posix.pid_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const rc = linux.syscall2(linux.SYS.clone3, @intFromPtr(&args), @sizeOf(@TypeOf(args)));
|
const rc = linux.syscall2(linux.SYS.clone3, @intFromPtr(&args), @sizeOf(@TypeOf(args)));
|
||||||
|
// do not use posix.errno, when linking libc it will use the libc errno which will not be set when making the syscall directly
|
||||||
return switch (std.os.linux.E.init(rc)) {
|
return switch (std.os.linux.E.init(rc)) {
|
||||||
.SUCCESS => @as(posix.pid_t, @intCast(rc)),
|
.SUCCESS => @as(posix.pid_t, @intCast(rc)),
|
||||||
else => |errno| err: {
|
else => |errno| err: {
|
||||||
|
Reference in New Issue
Block a user