Skip to content

Commit

Permalink
syscalls: handle fstat() for non-blocking cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Jan 14, 2025
1 parent 216b225 commit 2b005c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/syscalls/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,13 @@ void syscallDispatchFStat(SyscallRequest *req) {
req->requestID = syscallID();

int status = fstat(req->thread, req->requestID, req->params[0], (struct stat *)req->params[1]);
if(status) {
if(status < 0) {
req->external = false;
req->ret = status; // error code
req->unblock = true;
} else if(status == 1) { // return without blocking
req->ret = 0;
req->unblock = true;
} else {
// block until completion
req->external = true;
Expand Down

0 comments on commit 2b005c7

Please sign in to comment.