From e9475549fc0654df6ceb23e89e0d1dcb3dba62dc Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sun, 11 Jan 2026 07:17:52 -0800 Subject: [PATCH] [libc] Add ppoll stub to match existing pselect stub. NFC This is mostly just for consistency and completeness. --- system/lib/libc/emscripten_syscall_stubs.c | 1 + system/lib/libc/musl/arch/emscripten/bits/syscall.h | 1 + system/lib/libc/musl/arch/emscripten/syscall_arch.h | 1 + test/codesize/test_codesize_hello_dylink_all.json | 9 ++++++--- tools/system_libs.py | 1 - 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/system/lib/libc/emscripten_syscall_stubs.c b/system/lib/libc/emscripten_syscall_stubs.c index 23e2135a4b650..f2ab2e5b4f06d 100644 --- a/system/lib/libc/emscripten_syscall_stubs.c +++ b/system/lib/libc/emscripten_syscall_stubs.c @@ -264,6 +264,7 @@ UNIMPLEMENTED(acct, (intptr_t filename)) UNIMPLEMENTED(mincore, (intptr_t addr, size_t length, intptr_t vec)) UNIMPLEMENTED(pipe2, (intptr_t fds, int flags)) UNIMPLEMENTED(pselect6, (int nfds, intptr_t readfds, intptr_t writefds, intptr_t exceptfds, intptr_t timeout, intptr_t sigmaks)) +UNIMPLEMENTED(ppoll, (intptr_t fds, int nfds, intptr_t timeout, intptr_t sigmask, int size)) UNIMPLEMENTED(recvmmsg, (int sockfd, intptr_t msgvec, size_t vlen, int flags, ...)) UNIMPLEMENTED(sendmmsg, (int sockfd, intptr_t msgvec, size_t vlen, int flags, ...)) UNIMPLEMENTED(shutdown, (int sockfd, int how, int dummy, int dummy2, int dummy3, int dummy4)) diff --git a/system/lib/libc/musl/arch/emscripten/bits/syscall.h b/system/lib/libc/musl/arch/emscripten/bits/syscall.h index be60e3d046ffc..e4194e9aa0804 100644 --- a/system/lib/libc/musl/arch/emscripten/bits/syscall.h +++ b/system/lib/libc/musl/arch/emscripten/bits/syscall.h @@ -67,6 +67,7 @@ #define SYS_fchmodat2 __syscall_fchmodat2 #define SYS_faccessat __syscall_faccessat #define SYS_pselect6 __syscall_pselect6 +#define SYS_ppoll __syscall_ppoll #define SYS_utimensat __syscall_utimensat #define SYS_fallocate __syscall_fallocate #define SYS_dup3 __syscall_dup3 diff --git a/system/lib/libc/musl/arch/emscripten/syscall_arch.h b/system/lib/libc/musl/arch/emscripten/syscall_arch.h index 33fc42a99be3b..64e6cea850d81 100644 --- a/system/lib/libc/musl/arch/emscripten/syscall_arch.h +++ b/system/lib/libc/musl/arch/emscripten/syscall_arch.h @@ -91,6 +91,7 @@ int __syscall_readlinkat(int dirfd, intptr_t path, intptr_t buf, size_t bufsize) int __syscall_fchmodat2(int dirfd, intptr_t path, int mode, int flags); int __syscall_faccessat(int dirfd, intptr_t path, int amode, int flags); int __syscall_pselect6(int nfds, intptr_t readfds, intptr_t writefds, intptr_t exceptfds, intptr_t timeout, intptr_t sigmask); +int __syscall_ppoll(intptr_t fds, int nfds, intptr_t timeout, intptr_t sigmask, int size); int __syscall_utimensat(int dirfd, intptr_t path, intptr_t times, int flags); int __syscall_fallocate(int fd, int mode, off_t offset, off_t len); int __syscall_dup3(int fd, int suggestfd, int flags); diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 0ba509a1d7f0c..e3040a1f35327 100644 --- a/test/codesize/test_codesize_hello_dylink_all.json +++ b/test/codesize/test_codesize_hello_dylink_all.json @@ -1,7 +1,7 @@ { "a.out.js": 244848, - "a.out.nodebug.wasm": 577782, - "total": 822630, + "a.out.nodebug.wasm": 577879, + "total": 822727, "sent": [ "IMG_Init", "IMG_Load", @@ -1892,6 +1892,7 @@ "__syscall_pause", "__syscall_pipe2", "__syscall_poll", + "__syscall_ppoll", "__syscall_prlimit64", "__syscall_pselect6", "__syscall_recvmmsg", @@ -2829,6 +2830,7 @@ "pow10l", "powf", "powl", + "ppoll", "pread", "preadv", "printf", @@ -3756,9 +3758,9 @@ "$__syscall_pause", "$__syscall_pipe2", "$__syscall_poll", + "$__syscall_ppoll", "$__syscall_prlimit64", "$__syscall_pselect6", - "$__syscall_recvmmsg", "$__syscall_setdomainname", "$__syscall_setpgid", "$__syscall_setpriority", @@ -4597,6 +4599,7 @@ "$pow", "$powf", "$powl", + "$ppoll", "$pread", "$preadv", "$printf", diff --git a/tools/system_libs.py b/tools/system_libs.py index 3cdf76d9af161..6b60399362704 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1153,7 +1153,6 @@ def get_files(self): 'memcpy.c', 'memset.c', 'memmove.c', 'getaddrinfo.c', 'getnameinfo.c', 'res_query.c', 'res_querydomain.c', 'proto.c', - 'ppoll.c', 'syscall.c', 'popen.c', 'pclose.c', 'getgrouplist.c', 'initgroups.c', 'wordexp.c', 'timer_create.c', 'getauxval.c',