mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 00:23:22 +00:00
link: use std.os.ptrace wrapper on linux
This commit is contained in:
parent
a23ef3783b
commit
e35c8a2fd6
14
src/link.zig
14
src/link.zig
@ -389,11 +389,8 @@ pub const File = struct {
|
||||
try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, tmp_sub_path, .{});
|
||||
try emit.directory.handle.rename(tmp_sub_path, emit.sub_path);
|
||||
switch (builtin.os.tag) {
|
||||
.linux => {
|
||||
switch (std.os.errno(std.os.linux.ptrace(std.os.linux.PTRACE.ATTACH, pid, 0, 0, 0))) {
|
||||
.SUCCESS => {},
|
||||
else => |errno| log.warn("ptrace failure: {s}", .{@tagName(errno)}),
|
||||
}
|
||||
.linux => std.os.ptrace(std.os.linux.PTRACE.ATTACH, pid, 0, 0) catch |err| {
|
||||
log.warn("ptrace failure: {s}", .{@errorName(err)});
|
||||
},
|
||||
else => return error.HotSwapUnavailableOnHostOperatingSystem,
|
||||
}
|
||||
@ -430,11 +427,8 @@ pub const File = struct {
|
||||
|
||||
if (base.child_pid) |pid| {
|
||||
switch (builtin.os.tag) {
|
||||
.linux => {
|
||||
switch (std.os.errno(std.os.linux.ptrace(std.os.linux.PTRACE.DETACH, pid, 0, 0, 0))) {
|
||||
.SUCCESS => {},
|
||||
else => |errno| log.warn("ptrace failure: {s}", .{@tagName(errno)}),
|
||||
}
|
||||
.linux => std.os.ptrace(std.os.linux.PTRACE.DETACH, pid, 0, 0) catch |err| {
|
||||
log.warn("ptrace failure: {s}", .{@errorName(err)});
|
||||
},
|
||||
else => return error.HotSwapUnavailableOnHostOperatingSystem,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user