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

@ -24,7 +24,6 @@ use libc::{
close, close,
dup2, dup2,
exit, exit,
fcntl,
fstat, fstat,
getpid, getpid,
// readlink, // readlink,
@ -596,25 +595,6 @@ pub fn ___syscall218(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
-1 -1
} }
// fcntl64
pub fn ___syscall221(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall221 (fcntl64) {}", _which);
// fcntl64
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
}
pub fn ___syscall268(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { pub fn ___syscall268(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall268"); debug!("emscripten::___syscall268");
-1 -1

View File

@ -1076,6 +1076,24 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
pos as 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 /// fallocate
pub fn ___syscall324(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { pub fn ___syscall324(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall324 (fallocate) {}", _which); debug!("emscripten::___syscall324 (fallocate) {}", _which);

View File

@ -291,6 +291,12 @@ pub fn ___syscall220(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
-1 -1
} }
// fcntl64
pub fn ___syscall221(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall221 (fcntl64) {}", _which);
-1
}
/// fchown /// fchown
pub fn ___syscall207(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int { pub fn ___syscall207(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall207 (fchown) {}", _which); debug!("emscripten::___syscall207 (fchown) {}", _which);