| 1 | const builtin = @import("builtin"); |
| 2 | |
| 3 | const std = @import("std"); |
| 4 | |
| 5 | const symbol = @import("../../c.zig").symbol; |
| 6 | const errno = @import("../../c.zig").errno; |
| 7 | |
| 8 | comptime { |
| 9 | if (builtin.target.isMuslLibC()) { |
| 10 | symbol(&rebootLinux, "reboot"); |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | fn rebootLinux(cmd: c_int) callconv(.c) c_int { |
| 15 | return errno(std.os.linux.reboot(.MAGIC1, .MAGIC2, @fromBackingInt(@intCast(cmd)), null)); |
| 16 | } |