@@ -13,7 +13,8 @@ fn main() {
13
13
let linux = target. contains ( "unknown-linux" ) ;
14
14
let android = target. contains ( "android" ) ;
15
15
let apple = target. contains ( "apple" ) ;
16
- let musl = target. contains ( "musl" ) ;
16
+ let emscripten = target. contains ( "asm" ) ;
17
+ let musl = target. contains ( "musl" ) || emscripten;
17
18
let uclibc = target. contains ( "uclibc" ) ;
18
19
let freebsd = target. contains ( "freebsd" ) ;
19
20
let dragonfly = target. contains ( "dragonfly" ) ;
@@ -25,7 +26,7 @@ fn main() {
25
26
let mut cfg = ctest:: TestGenerator :: new ( ) ;
26
27
27
28
// Pull in extra goodies
28
- if linux || android {
29
+ if linux || android || emscripten {
29
30
cfg. define ( "_GNU_SOURCE" , None ) ;
30
31
} else if netbsd {
31
32
cfg. define ( "_NETBSD_SOURCE" , Some ( "1" ) ) ;
@@ -165,7 +166,7 @@ fn main() {
165
166
}
166
167
}
167
168
168
- if linux {
169
+ if linux || emscripten {
169
170
cfg. header ( "mqueue.h" ) ;
170
171
cfg. header ( "ucontext.h" ) ;
171
172
cfg. header ( "sys/signalfd.h" ) ;
@@ -183,7 +184,7 @@ fn main() {
183
184
cfg. header ( "shadow.h" ) ;
184
185
}
185
186
186
- if linux || android {
187
+ if linux || android || emscripten {
187
188
cfg. header ( "malloc.h" ) ;
188
189
cfg. header ( "net/ethernet.h" ) ;
189
190
cfg. header ( "netpacket/packet.h" ) ;
@@ -237,7 +238,7 @@ fn main() {
237
238
cfg. header ( "sys/ioctl_compat.h" ) ;
238
239
}
239
240
240
- if linux || freebsd || dragonfly || netbsd || apple {
241
+ if linux || emscripten || freebsd || dragonfly || netbsd || apple {
241
242
if !uclibc {
242
243
cfg. header ( "aio.h" ) ;
243
244
}
@@ -356,6 +357,9 @@ fn main() {
356
357
"FILE_ATTRIBUTE_INTEGRITY_STREAM" |
357
358
"ERROR_NOTHING_TO_TERMINATE" if mingw => true ,
358
359
360
+ // not defined
361
+ "IUTF8" | "ENOATTR" | "EXTA" | "EXTB" if emscripten => true ,
362
+
359
363
"SIG_IGN" => true , // sighandler_t weirdness
360
364
361
365
// types on musl are defined a little differently
@@ -428,6 +432,34 @@ fn main() {
428
432
"prlimit" | "prlimit64" | // non-int in 2nd arg
429
433
"strerror_r" if linux => true , // actually xpg-something-or-other
430
434
435
+ // not defined or fails to link
436
+ "aio_cancel" | "aio_error" | "aio_fsync" | "aio_read" | "aio_read_write" | "aio_return" |
437
+ "aio_suspend" | "aio_write" | "clock_nanosleep" | "clone" | "daemon" | "endspent" |
438
+ "epoll_create" | "epoll_create1" | "epoll_ctl" | "epoll_pwait" | "epoll_wait" |
439
+ "eventfd" | "faccessat" | "fallocate" | "fgetxattr" | "flistxattr" | "fork" |
440
+ "forkpty" | "fremovexattr" | "fsetxattr" | "ftok" | "futimes" | "getdtablesize" |
441
+ "getgrgid" | "getgrnam" | "getgroups" | "getpgid" | "getpgrp" | "getpwnam_r" |
442
+ "getpwuid_r" | "getspent" | "getspnam" | "getxattr" | "initgroups" | "lgetxattr" |
443
+ "listxattr" | "llistxattr" | "lremovexattr" | "lsetxattr" | "lutimes" | "mount" |
444
+ "mq_close" | "mq_getattr" | "mq_open" | "mq_receive" | "mq_send" | "mq_setattr" |
445
+ "mq_unlink" | "msgctl" | "msgget" | "msgrcv" | "msgsnd" | "pclose" | "popen" |
446
+ "ppoll" | "prctl" | "prlimit" | "prlimit64" | "process_vm_readv" |
447
+ "process_vm_writev" | "pthread_atfork" | "pthread_attr_getguardsize" |
448
+ "pthread_kill" | "pthread_mutexattr_getpshared" | "pthread_mutex_timedlock" |
449
+ "pthread_sigmask" | "ptrace" | "quotactl" | "readahead" | "reboot" | "removexattr" |
450
+ "sched_getaffinity" | "sched_getparam" | "sched_get_priority_max" |
451
+ "sched_get_priority_min" | "sched_getscheduler" | "sched_rr_get_interval" |
452
+ "sched_setaffinity" | "sched_setparam" | "sched_setscheduler" | "sem_close" |
453
+ "semctl" | "semget" | "semop" | "sem_open" | "sem_timedwait" | "sem_unlink" |
454
+ "sendfile" | "setfsgid" | "setfsuid" | "setgroups" | "sethostname" | "setns" |
455
+ "setpgid" | "setpgrp" | "setspent" | "settimeofday" | "setxattr" | "shmat" |
456
+ "shmctl" | "shmdt" | "shmget" | "sigaltstack" | "signalfd" | "sigsuspend" |
457
+ "sigtimedwait" | "sigwait" | "sigwaitinfo" | "splice" | "sync_file_range" |
458
+ "syscall" | "sysinfo" | "tee" | "umount" | "umount2" | "unshare" | "vmsplice"
459
+ if emscripten => true ,
460
+
461
+ // n if n.starts_with("epoll") && emscripten => true,
462
+
431
463
// int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that
432
464
// they match the interface defined by Linux verbatim, but they conflict with other
433
465
// send*/recv* syscalls
0 commit comments