You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The std.posix.errno function contains a check if libc is linked. if it is, then it assumes that a syscall will return -1 on failure and set the C's errno value. It seems like it assumes when libc is linked then all syscalls are made using the libc. The problem is that some syscalls dont have a libc wrap (such as perf_event_open) so it still calls the raw syscall
When the syscalls fails the errno wrongly returns SUCCESS and then the perf_event_open .SUCCESSintCast crashes.
I guess better solution could be two separate errno functions, one for syscalls and one for libc functions?
Expected Behavior
No crash, corrent error returned.
The text was updated successfully, but these errors were encountered:
Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Behavior
The std.posix.errno function contains a check if libc is linked. if it is, then it assumes that a syscall will return -1 on failure and set the C's errno value. It seems like it assumes when libc is linked then all syscalls are made using the libc. The problem is that some syscalls dont have a libc wrap (such as
perf_event_open
) so it still calls the raw syscallWhen the syscalls fails the errno wrongly returns SUCCESS and then the perf_event_open
.SUCCESS
intCast
crashes.I guess better solution could be two separate errno functions, one for syscalls and one for libc functions?
Expected Behavior
No crash, corrent error returned.
The text was updated successfully, but these errors were encountered: