From cdb1a868130a072a60ce8e23926bd66480926a9b Mon Sep 17 00:00:00 2001 From: iMoD1998 <16210252+iMoD1998@users.noreply.github.com> Date: Mon, 9 Nov 2026 00:48:48 +0000 Subject: [PATCH] Fix fcntl64 EBADF --- qiling/os/posix/syscall/fcntl.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/qiling/os/posix/syscall/fcntl.py b/qiling/os/posix/syscall/fcntl.py index 13d60701e..5268039a2 100644 --- a/qiling/os/posix/syscall/fcntl.py +++ b/qiling/os/posix/syscall/fcntl.py @@ -120,13 +120,10 @@ def ql_syscall_fcntl(ql: Qiling, fd: int, cmd: int, arg: int): def ql_syscall_fcntl64(ql: Qiling, fd: int, cmd: int, arg: int): - if fd not in range(NR_OPEN): - return -1 - - f = ql.os.fd[fd] + f = get_opened_fd(ql.os, fd) if f is None: - return -1 + return -EBADF # https://linux.die.net/man/2/fcntl64 if cmd == F_DUPFD: