File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
system/lib/libc/musl/src/fcntl Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 33#include <stdarg.h>
44#include <errno.h>
55#include "syscall.h"
6+ #include <emscripten/console.h>
67
7- #ifdef __EMSCRIPTEN__
8- __attribute__((no_sanitize ("address" )))
9- #endif
108int fcntl (int fd , int cmd , ...)
119{
12- unsigned long arg ;
10+ #ifdef __EMSCRIPTEN__
1311 // XXX Emscripten: According to the va_arg man page it is undefined behaviour to
1412 // read arguments that are not passed. This can lead to a false positive
1513 // in SAFE_HEAP, so avoid it.
14+ unsigned long arg = 0 ;
1615 if (cmd != F_GETFL && cmd != F_GETFD && cmd != F_GETOWN ) {
1716 va_list ap ;
1817 va_start (ap , cmd );
1918 arg = va_arg (ap , unsigned long );
2019 va_end (ap );
2120 }
21+ #else
22+ unsigned long arg ;
23+ va_list ap ;
24+ va_start (ap , cmd );
25+ arg = va_arg (ap , unsigned long );
26+ va_end (ap );
27+ #endif
2228 if (cmd == F_SETFL ) arg |= O_LARGEFILE ;
2329 if (cmd == F_SETLKW ) return syscall_cp (SYS_fcntl , fd , cmd , (void * )arg );
2430 if (cmd == F_GETOWN ) {
You can’t perform that action at this time.
0 commit comments