Skip to content

Commit 97909a0

Browse files
committed
Build the process submodule with musl to add support to missing process spawn functions.
1 parent 943d566 commit 97909a0

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

src/library_syscall.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ var SyscallsLibrary = {
211211
Module['exit'](status);
212212
return 0;
213213
},
214+
__syscall2: function(which, varargs) { // fork
215+
___setErrNo(ERRNO_CODES.ENOSYS);
216+
return -1;
217+
},
214218
__syscall3: function(which, varargs) { // read
215219
var stream = SYSCALLS.getStreamFromFD(), buf = SYSCALLS.get(), count = SYSCALLS.get();
216220
return FS.read(stream, {{{ makeGetSlabs('buf', 'i8', true) }}}, buf, count);
@@ -238,6 +242,10 @@ var SyscallsLibrary = {
238242
FS.unlink(path);
239243
return 0;
240244
},
245+
__syscall11: function(which, varargs) { // execve
246+
___setErrNo(ERRNO_CODES.ENOSYS);
247+
return -1;
248+
},
241249
__syscall12: function(which, varargs) { // chdir
242250
var path = SYSCALLS.getStr();
243251
FS.chdir(path);
@@ -1053,6 +1061,10 @@ var SyscallsLibrary = {
10531061
__syscall272: function(which, varargs) { // fadvise64_64
10541062
return 0; // your advice is important to us (but we can't use it)
10551063
},
1064+
__syscall284: function(which, varargs) { // waitid
1065+
___setErrNo(ERRNO_CODES.ENOSYS);
1066+
return -1;
1067+
},
10561068
__syscall295: function(which, varargs) { // openat
10571069
#if SYSCALL_DEBUG
10581070
Module.printErr('warning: untested syscall');

system/lib/libc.symbols

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,10 @@
837837
T posix_madvise
838838
W posix_memalign
839839
T posix_openpt
840-
U posix_spawn
841-
U posix_spawn_file_actions_adddup2
842-
U posix_spawn_file_actions_destroy
843-
U posix_spawn_file_actions_init
840+
T posix_spawn
841+
T posix_spawn_file_actions_adddup2
842+
T posix_spawn_file_actions_destroy
843+
T posix_spawn_file_actions_init
844844
W pow10
845845
W pow10f
846846
W pow10l

system/lib/libc/musl/arch/emscripten/syscall_arch.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
// static syscalls. we must have one non-variadic argument before the rest due to ISO C.
2828

2929
long __syscall1(int which, ...);
30+
long __syscall2(int which, ...);
3031
long __syscall3(int which, ...);
3132
long __syscall4(int which, ...);
3233
long __syscall5(int which, ...);
3334
long __syscall6(int which, ...);
3435
long __syscall9(int which, ...);
3536
long __syscall10(int which, ...);
37+
long __syscall11(int which, ...);
3638
long __syscall12(int which, ...);
3739
long __syscall14(int which, ...);
3840
long __syscall15(int which, ...);
@@ -107,6 +109,8 @@ long __syscall208(int which, ...);
107109
long __syscall209(int which, ...);
108110
long __syscall211(int which, ...);
109111
long __syscall212(int which, ...);
112+
long __syscall213(int which, ...);
113+
long __syscall214(int which, ...);
110114
long __syscall218(int which, ...);
111115
long __syscall219(int which, ...);
112116
long __syscall220(int which, ...);
@@ -116,6 +120,7 @@ long __syscall265(int which, ...);
116120
long __syscall268(int which, ...);
117121
long __syscall269(int which, ...);
118122
long __syscall272(int which, ...);
123+
long __syscall284(int which, ...);
119124
long __syscall295(int which, ...);
120125
long __syscall296(int which, ...);
121126
long __syscall297(int which, ...);

tools/system_libs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_libc(libname):
9393
]
9494
musl_srcdir = shared.path_from_root('system', 'lib', 'libc', 'musl', 'src')
9595
blacklist = set(
96-
['ipc', 'passwd', 'thread', 'signal', 'sched', 'ipc', 'time', 'linux', 'aio', 'exit', 'legacy', 'mq', 'process', 'search', 'setjmp', 'env', 'ldso', 'conf'] + # musl modules
96+
['ipc', 'passwd', 'thread', 'signal', 'sched', 'ipc', 'time', 'linux', 'aio', 'exit', 'legacy', 'mq', 'search', 'setjmp', 'env', 'ldso', 'conf'] + # musl modules
9797
['memcpy.c', 'memset.c', 'memmove.c', 'getaddrinfo.c', 'getnameinfo.c', 'inet_addr.c', 'res_query.c', 'gai_strerror.c', 'proto.c', 'gethostbyaddr.c', 'gethostbyaddr_r.c', 'gethostbyname.c', 'gethostbyname2_r.c', 'gethostbyname_r.c', 'gethostbyname2.c', 'usleep.c', 'alarm.c', 'syscall.c'] + # individual files
9898
['abs.c', 'cos.c', 'cosf.c', 'cosl.c', 'sin.c', 'sinf.c', 'sinl.c', 'tan.c', 'tanf.c', 'tanl.c', 'acos.c', 'acosf.c', 'acosl.c', 'asin.c', 'asinf.c', 'asinl.c', 'atan.c', 'atanf.c', 'atanl.c', 'atan2.c', 'atan2f.c', 'atan2l.c', 'exp.c', 'expf.c', 'expl.c', 'log.c', 'logf.c', 'logl.c', 'sqrt.c', 'sqrtf.c', 'sqrtl.c', 'fabs.c', 'fabsf.c', 'fabsl.c', 'ceil.c', 'ceilf.c', 'ceill.c', 'floor.c', 'floorf.c', 'floorl.c', 'pow.c', 'powf.c', 'powl.c'] # individual math files
9999
)

0 commit comments

Comments
 (0)