aboutsummaryrefslogtreecommitdiff
path: root/src/linux_c.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-11 19:14:34 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-11 19:14:34 -0700
commitcbb88672f217a90db1aa1eb29cd92d5d9035b22b (patch)
tree43a00501f3cde495967e116f0b660777051551f8 /src/linux_c.zig
parent1f900cff453700b19bca2acadfe26da4468c1282 (diff)
parent34b0e7a2bbd8bf8097341cdb0075d0908283e834 (diff)
downloadbun-jarred/esm-conditions.tar.gz
bun-jarred/esm-conditions.tar.zst
bun-jarred/esm-conditions.zip
Merge branch 'main' into jarred/esm-conditionsjarred/esm-conditions
Diffstat (limited to 'src/linux_c.zig')
-rw-r--r--src/linux_c.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linux_c.zig b/src/linux_c.zig
index dade43a32..12e3c9b73 100644
--- a/src/linux_c.zig
+++ b/src/linux_c.zig
@@ -148,7 +148,7 @@ pub const SystemErrno = enum(u8) {
}
if (code >= max) return null;
- return @intToEnum(SystemErrno, code);
+ return @enumFromInt(SystemErrno, code);
}
pub fn label(this: SystemErrno) ?[]const u8 {
@@ -385,9 +385,9 @@ pub fn splice(fd_in: std.os.fd_t, off_in: ?*i64, fd_out: std.os.fd_t, off_out: ?
return std.os.linux.syscall6(
.splice,
@bitCast(usize, @as(isize, fd_in)),
- @ptrToInt(off_in),
+ @intFromPtr(off_in),
@bitCast(usize, @as(isize, fd_out)),
- @ptrToInt(off_out),
+ @intFromPtr(off_out),
len,
flags,
);
@@ -438,9 +438,9 @@ pub fn get_system_loadavg() [3]f64 {
var info: struct_sysinfo = undefined;
if (sysinfo(&info) == @as(c_int, 0)) {
return [3]f64{
- std.math.ceil((@intToFloat(f64, info.loads[0]) / 65536.0) * 100.0) / 100.0,
- std.math.ceil((@intToFloat(f64, info.loads[1]) / 65536.0) * 100.0) / 100.0,
- std.math.ceil((@intToFloat(f64, info.loads[2]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[0]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[1]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[2]) / 65536.0) * 100.0) / 100.0,
};
}
return [3]f64{ 0, 0, 0 };