0.3.0: converge relibc to upstream 0.6.0 + Red Bear patches

This commit is contained in:
2026-07-06 19:13:08 +03:00
parent 1a0edd8eeb
commit 4ef7e57571
1466 changed files with 75236 additions and 13644 deletions
+25 -8
View File
@@ -1,21 +1,38 @@
#include <assert.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include "test_helpers.h"
int main(void) {
void for_code(int code) {
pid_t pid = fork();
ERROR_IF(fork, pid, == -1);
// Testing successful exit
if (pid == 0) {
// child
sleep(1);
exit(EXIT_SUCCESS);
} else {
// parent
int stat_loc;
pid_t wid = waitpid(pid, &stat_loc, 0);
ERROR_IF(waitpid, wid, == -1);
usleep(100000);
_Exit(code);
}
printf("Testing waitpid of child %d for code %d\n", pid, code);
// parent
int status;
pid_t wid = waitpid(pid, &status, 0);
ERROR_IF(waitpid, wid, == -1);
assert(WIFEXITED(status));
assert(WEXITSTATUS(status) == code);
puts("Success");
}
int main(void) {
for_code(EXIT_SUCCESS);
for_code(EXIT_FAILURE);
for_code(42);
for_code(255);
// TODO: Also add coverage for e.g. WIFSTOPPED, WSTOPSIG, WTERMSIG, etc
return EXIT_SUCCESS;
}