fix: restore additional syscalls

main
Sean McBride 4 years ago
parent cfad9093ad
commit abbce7df68

@ -624,6 +624,7 @@ wasm_get_time(int32_t clock_id, int32_t timespec_off)
return res; return res;
} }
#define SYS_EXIT 60
#define SYS_EXIT_GROUP 231 #define SYS_EXIT_GROUP 231
int32_t int32_t
wasm_exit_group(int32_t status) wasm_exit_group(int32_t status)
@ -711,13 +712,24 @@ inner_syscall_handler(int32_t n, int32_t a, int32_t b, int32_t c, int32_t d, int
return wasm_write(a, b, c); return wasm_write(a, b, c);
case SYS_WRITEV: case SYS_WRITEV:
return wasm_writev(a, b, c); return wasm_writev(a, b, c);
case SYS_CLOSE:
return wasm_close(a);
case SYS_LSEEK:
return wasm_lseek(a, b, c);
case SYS_EXIT:
case SYS_EXIT_GROUP:
return wasm_exit_group(a);
case SYS_MMAP:
return wasm_mmap(a, b, c, d, e, f);
case SYS_GET_TIME:
return wasm_get_time(a, b);
case SYS_MUNMAP:
case SYS_IOCTL: case SYS_IOCTL:
case SYS_SET_THREAD_AREA: case SYS_SET_THREAD_AREA:
case SYS_SET_TID_ADDRESS: case SYS_SET_TID_ADDRESS:
case SYS_BRK:
/* Note: These are called, but are unimplemented and fail silently */ /* Note: These are called, but are unimplemented and fail silently */
return 0; return 0;
case SYS_MUNMAP:
case SYS_BRK:
case SYS_RT_SIGACTION: case SYS_RT_SIGACTION:
case SYS_RT_SIGPROGMASK: case SYS_RT_SIGPROGMASK:
case SYS_MADVISE: case SYS_MADVISE:
@ -727,14 +739,11 @@ inner_syscall_handler(int32_t n, int32_t a, int32_t b, int32_t c, int32_t d, int
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;
/* TODO: The calls below need to be validated / refactored to be non-blocking */ /* TODO: The calls below need to be validated / refactored to be non-blocking */
// case SYS_READV: // case SYS_READV:
// return wasm_readv(a, b, c); // return wasm_readv(a, b, c);
// case SYS_OPEN: // case SYS_OPEN:
// return wasm_open(a, b, c); // return wasm_open(a, b, c);
// case SYS_CLOSE:
// return wasm_close(a);
// case SYS_STAT: // case SYS_STAT:
// return wasm_stat(a, b); // return wasm_stat(a, b);
// case SYS_FSTAT: // case SYS_FSTAT:
@ -743,8 +752,6 @@ inner_syscall_handler(int32_t n, int32_t a, int32_t b, int32_t c, int32_t d, int
// return wasm_lstat(a, b); // return wasm_lstat(a, b);
// case SYS_LSEEK: // case SYS_LSEEK:
// return wasm_lseek(a, b, c); // return wasm_lseek(a, b, c);
// case SYS_MMAP:
// return wasm_mmap(a, b, c, d, e, f);
// case SYS_GETPID: // case SYS_GETPID:
// return wasm_getpid(); // return wasm_getpid();
// case SYS_FCNTL: // case SYS_FCNTL:
@ -757,10 +764,6 @@ inner_syscall_handler(int32_t n, int32_t a, int32_t b, int32_t c, int32_t d, int
// return wasm_getcwd(a, b); // return wasm_getcwd(a, b);
// case SYS_GETEUID: // case SYS_GETEUID:
// return wasm_geteuid(); // return wasm_geteuid();
// case SYS_GET_TIME:
// return wasm_get_time(a, b);
// case SYS_EXIT_GROUP:
// return wasm_exit_group(a);
// case SYS_FCHOWN: // case SYS_FCHOWN:
// return wasm_fchown(a, b, c); // return wasm_fchown(a, b, c);
// case SYS_SOCKET: // case SYS_SOCKET:

Loading…
Cancel
Save