From 566782ab138cbc9e1442b297901dcd0eeb81c899 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 1 Jun 2026 16:13:27 -0700 Subject: [PATCH] Remove __syscall_pause --- system/include/emscripten/syscalls.h | 1 - system/lib/libc/emscripten_syscall_stubs.c | 5 ----- system/lib/libc/musl/arch/emscripten/bits/syscall.h | 1 - system/lib/libc/musl/src/internal/syscall.h | 6 ++++++ system/lib/standalone/standalone.c | 4 ---- test/codesize/test_codesize_hello_dylink_all.json | 2 -- test/unistd/misc.out | 2 +- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/system/include/emscripten/syscalls.h b/system/include/emscripten/syscalls.h index 218a8bad4281e..a01c138c05b5d 100644 --- a/system/include/emscripten/syscalls.h +++ b/system/include/emscripten/syscalls.h @@ -19,7 +19,6 @@ int __syscall_chdir(intptr_t path); int __syscall_mknod(intptr_t path, int mode, int dev); int __syscall_chmod(intptr_t path, int mode); int __syscall_getpid(void); -int __syscall_pause(void); int __syscall_access(intptr_t path, int amode); int __syscall_sync(void); int __syscall_rmdir(intptr_t path); diff --git a/system/lib/libc/emscripten_syscall_stubs.c b/system/lib/libc/emscripten_syscall_stubs.c index 5f5b23ef35a92..809027da5a03a 100644 --- a/system/lib/libc/emscripten_syscall_stubs.c +++ b/system/lib/libc/emscripten_syscall_stubs.c @@ -180,11 +180,6 @@ weak int __syscall_getresgid32(intptr_t ruid, intptr_t euid, intptr_t suid) { return 0; } -weak int __syscall_pause() { - REPORT(pause); - return -EINTR; // we can't pause -} - weak int __syscall_madvise(intptr_t addr, size_t length, int advice) { REPORT(madvise); // advice is welcome, but ignored diff --git a/system/lib/libc/musl/arch/emscripten/bits/syscall.h b/system/lib/libc/musl/arch/emscripten/bits/syscall.h index e3465a65c7406..f78cf22e63536 100644 --- a/system/lib/libc/musl/arch/emscripten/bits/syscall.h +++ b/system/lib/libc/musl/arch/emscripten/bits/syscall.h @@ -1,7 +1,6 @@ #define SYS_chdir __syscall_chdir #define SYS_chmod __syscall_chmod #define SYS_getpid __syscall_getpid -#define SYS_pause __syscall_pause #define SYS_sync __syscall_sync #define SYS_rmdir __syscall_rmdir #define SYS_dup __syscall_dup diff --git a/system/lib/libc/musl/src/internal/syscall.h b/system/lib/libc/musl/src/internal/syscall.h index be10369af0b8e..d957750cf1bd9 100644 --- a/system/lib/libc/musl/src/internal/syscall.h +++ b/system/lib/libc/musl/src/internal/syscall.h @@ -430,6 +430,12 @@ hidden long __syscall_ret(unsigned long), #ifdef SYS_pause #define __sys_pause() __syscall(SYS_pause) #define __sys_pause_cp() __syscall_cp(SYS_pause) +#elif defined(__EMSCRIPTEN__) +/* Note: When the sigmask argument is NULL, ppoll() differs from poll() only + * in the precision of the timeout argument. For poll -1 means block forever + * as opposed to ppoll which uses NULL/0. */ +#define __sys_pause() __syscall(SYS_poll, 0, 0, -1) +#define __sys_pause_cp() __syscall_cp(SYS_poll, 0, 0, -1) #else #define __sys_pause() __syscall(SYS_ppoll, 0, 0, 0, 0) #define __sys_pause_cp() __syscall_cp(SYS_ppoll, 0, 0, 0, 0) diff --git a/system/lib/standalone/standalone.c b/system/lib/standalone/standalone.c index 87e6a9d20bcbe..755049544e0b7 100644 --- a/system/lib/standalone/standalone.c +++ b/system/lib/standalone/standalone.c @@ -115,10 +115,6 @@ weak int __syscall_newfstatat(int dirfd, intptr_t path, intptr_t buf, int flags) return -ENOSYS; } -weak int __syscall_pause() { - return -ENOSYS; -} - weak int __syscall_lstat64(intptr_t path, intptr_t buf) { return -ENOSYS; } diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 6a0721e75b93f..c7ef6b6852523 100644 --- a/test/codesize/test_codesize_hello_dylink_all.json +++ b/test/codesize/test_codesize_hello_dylink_all.json @@ -2219,7 +2219,6 @@ "__syscall_munlock", "__syscall_munlockall", "__syscall_munmap", - "__syscall_pause", "__syscall_prlimit64", "__syscall_recvmmsg", "__syscall_sendmmsg", @@ -4089,7 +4088,6 @@ "$__syscall_mremap", "$__syscall_msync", "$__syscall_munmap", - "$__syscall_pause", "$__syscall_prlimit64", "$__syscall_recvmmsg", "$__syscall_setdomainname", diff --git a/test/unistd/misc.out b/test/unistd/misc.out index 4ed4b37a3b5fd..0fa3ae2deeff9 100644 --- a/test/unistd/misc.out +++ b/test/unistd/misc.out @@ -10,7 +10,7 @@ link: -1, errno: 34 lockf(good): 0, errno: 0 lockf(bad): -1, errno: 8 nice: -1, errno: 63 -pause: -1, errno: 27 +pause: 0, errno: 0 pipe(good): 0, errno: 0 pipe(bad): -1, errno: 21 pipe2(good): 0, errno: 0