-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.os-linuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Zig Version
0.14.1
Steps to Reproduce and Observed Behavior
As an example, I have the following c code:
// test.c
#include <sys/wait.h>
#include <stdio.h>
int main() {
int s = 0x0080;
printf("%d, %d, %d, %d\n", WIFEXITED(s), WIFSTOPPED(s), WIFSIGNALED(s), WIFCONTINUED(s));
return 0;
}
I also have this zig code:
// test.zig
const std = @import("std");
pub fn main() !void {
const s: u32 = 0x0080;
std.debug.print("{}, {}, {}\n", .{
std.os.linux.W.IFEXITED(s),
std.os.linux.W.IFSTOPPED(s),
std.os.linux.W.IFSIGNALED(s),
// std.os.linux.W.IFCONTINUED(s)
});
}
The result is different:
$ zig run test.zig
true, true, true
$ gcc test.c; ./a.out
1, 0, 0, 0
Zig also does not have an equivalent function for the WIFCONTINUED(s) macro.
Expected Behavior
The result should be the same, and zig should implement the IFCONTINUED function.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.os-linuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.