Skip to content

Commit

Permalink
Adds wait4/wait3 to libc build, fixes emscripten-core#19188 (emscript…
Browse files Browse the repository at this point in the history
…en-core#22397)

Fixes missing `wait4` and `wait3` functions by adding the relevant
source files from the musl libc to the build process of the libc.
  • Loading branch information
Mai-Lapyst authored Aug 25, 2024
1 parent 561e0c9 commit c66e8cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions test/other/test_syscall_stubs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <sys/wait.h>
#include <stddef.h>

int main() {
// The current implementation uses the stub symbol __syscall_wait4.
// This test exists simply to ensure that it compile and link.
waitpid(0, NULL, 0);
wait3(NULL, 0, NULL);
wait4(0, NULL, 0, NULL);
}
Empty file.
3 changes: 3 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -12735,6 +12735,9 @@ def test_threadprofiler(self):
def test_syslog(self):
self.do_other_test('test_syslog.c')

def test_syscall_stubs(self):
self.do_other_test('test_syscall_stubs.c')

@parameterized({
'': (False, False),
'custom': (True, False),
Expand Down
2 changes: 1 addition & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ def get_files(self):

libc_files += files_in_path(
path='system/lib/libc/musl/src/linux',
filenames=['getdents.c', 'gettid.c', 'utimes.c', 'statx.c'])
filenames=['getdents.c', 'gettid.c', 'utimes.c', 'statx.c', 'wait4.c', 'wait3.c'])

libc_files += files_in_path(
path='system/lib/libc/musl/src/sched',
Expand Down

0 comments on commit c66e8cf

Please sign in to comment.