From 2e9697353cf479ea08ebf10778b1e2481d964588 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Sep 2016 10:10:27 -0600 Subject: [PATCH] Add wnohang, make PS/2 driver write input to display scheme, which then passes it to the shell --- syscall/process.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/syscall/process.rs b/syscall/process.rs index 34d5751..b38aee6 100644 --- a/syscall/process.rs +++ b/syscall/process.rs @@ -18,7 +18,7 @@ use elf::{self, program_header}; use scheme; use syscall; use syscall::error::*; -use syscall::flag::{CLONE_VM, CLONE_FS, CLONE_FILES, MAP_WRITE, MAP_WRITE_COMBINE}; +use syscall::flag::{CLONE_VM, CLONE_FS, CLONE_FILES, MAP_WRITE, MAP_WRITE_COMBINE, WNOHANG}; use syscall::validate::{validate_slice, validate_slice_mut}; pub fn brk(address: usize) -> Result { @@ -594,7 +594,7 @@ pub fn sched_yield() -> Result { Ok(0) } -pub fn waitpid(pid: usize, status_ptr: usize, _options: usize) -> Result { +pub fn waitpid(pid: usize, status_ptr: usize, flags: usize) -> Result { //TODO: Implement status_ptr and options loop { { @@ -616,6 +616,8 @@ pub fn waitpid(pid: usize, status_ptr: usize, _options: usize) -> Result if exited { let mut contexts = context::contexts_mut(); return contexts.remove(pid).ok_or(Error::new(ESRCH)).and(Ok(pid)); + } else if flags & WNOHANG == WNOHANG { + return Ok(0); } }