| ... | @@ -1039,10 +1039,9 @@ fn splitValue64(val: i64) [2]u32 { | ... | @@ -1039,10 +1039,9 @@ fn splitValue64(val: i64) [2]u32 { |
| 1039 | } | 1039 | } |
| 1040 | | 1040 | |
| 1041 | /// Get the errno from a syscall return value. SUCCESS means no error. | 1041 | /// Get the errno from a syscall return value. SUCCESS means no error. |
| 1042 | pub fn errno(r: u64) E { | 1042 | pub fn errno(r: anytype) E { |
| 1043 | const signed_r: i32 = @bitCast(@as(u32, @truncate(r))); | 1043 | const signed_r: @Int(.signed, @typeInfo(@TypeOf(r)).int.bits) = @bitCast(r); |
| 1044 | const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0; | 1044 | return @fromBackingInt(@intCast(if (signed_r > -4096 and signed_r < 0) -signed_r else 0)); |
| 1045 | return @fromBackingInt(@intCast(int)); | | |
| 1046 | } | 1045 | } |
| 1047 | | 1046 | |
| 1048 | pub fn brk(addr: usize) usize { | 1047 | pub fn brk(addr: usize) usize { |