Skip to content

Commit c66e8cf

Browse files
authored
Adds wait4/wait3 to libc build, fixes #19188 (#22397)
Fixes missing `wait4` and `wait3` functions by adding the relevant source files from the musl libc to the build process of the libc.
1 parent 561e0c9 commit c66e8cf

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

test/other/test_syscall_stubs.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <sys/wait.h>
2+
#include <stddef.h>
3+
4+
int main() {
5+
// The current implementation uses the stub symbol __syscall_wait4.
6+
// This test exists simply to ensure that it compile and link.
7+
waitpid(0, NULL, 0);
8+
wait3(NULL, 0, NULL);
9+
wait4(0, NULL, 0, NULL);
10+
}

test/other/test_syscall_stubs.out

Whitespace-only changes.

test/test_other.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12735,6 +12735,9 @@ def test_threadprofiler(self):
1273512735
def test_syslog(self):
1273612736
self.do_other_test('test_syslog.c')
1273712737

12738+
def test_syscall_stubs(self):
12739+
self.do_other_test('test_syscall_stubs.c')
12740+
1273812741
@parameterized({
1273912742
'': (False, False),
1274012743
'custom': (True, False),

tools/system_libs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ def get_files(self):
12391239

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

12441244
libc_files += files_in_path(
12451245
path='system/lib/libc/musl/src/sched',

0 commit comments

Comments
 (0)