Move emscripten ___syscall221 to the unix implementation

This commit is contained in:
Syrus
2019-07-07 23:36:50 -07:00
parent 72a80a6122
commit 680b833e94
3 changed files with 24 additions and 20 deletions

View File

@ -1076,6 +1076,24 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
pos as i32
}
// fcntl64
pub fn ___syscall221(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall221 (fcntl64) {}", _which);
let fd: i32 = varargs.get(ctx);
let cmd: i32 = varargs.get(ctx);
let arg: i32 = varargs.get(ctx);
// (FAPPEND - 0x08
// |FASYNC - 0x40
// |FFSYNC - 0x80
// |FNONBLOCK - 0x04
let ret = unsafe { fcntl(fd, cmd, arg) };
debug!("=> fd: {}, cmd: {} = {}", fd, cmd, ret);
if ret == -1 {
debug!("=> last os error: {}", Error::last_os_error(),);
}
ret
}
/// fallocate
pub fn ___syscall324(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall324 (fallocate) {}", _which);