Update libstd. Add CWD and associated syscalls. Remove debugging
This commit is contained in:
parent
7561839cfc
commit
57f5699664
1 changed files with 113 additions and 12 deletions
|
|
@ -19,6 +19,8 @@ pub enum Call {
|
|||
WaitPid = 7,
|
||||
/// Execute syscall
|
||||
Exec = 11,
|
||||
/// Change working directory
|
||||
ChDir = 12,
|
||||
/// Get process ID
|
||||
GetPid = 20,
|
||||
/// Duplicate file descriptor
|
||||
|
|
@ -30,12 +32,15 @@ pub enum Call {
|
|||
/// Clone process
|
||||
Clone = 120,
|
||||
/// Yield to scheduler
|
||||
SchedYield = 158
|
||||
SchedYield = 158,
|
||||
/// Get process working directory
|
||||
GetCwd = 183
|
||||
}
|
||||
|
||||
/// Convert numbers to calls
|
||||
/// See http://syscalls.kernelgrok.com/
|
||||
impl Call {
|
||||
//TODO: Return Option<Call>
|
||||
pub fn from(number: usize) -> Result<Call> {
|
||||
match number {
|
||||
1 => Ok(Call::Exit),
|
||||
|
|
@ -45,12 +50,14 @@ impl Call {
|
|||
6 => Ok(Call::Close),
|
||||
7 => Ok(Call::WaitPid),
|
||||
11 => Ok(Call::Exec),
|
||||
12 => Ok(Call::ChDir),
|
||||
20 => Ok(Call::GetPid),
|
||||
41 => Ok(Call::Dup),
|
||||
45 => Ok(Call::Brk),
|
||||
110 => Ok(Call::Iopl),
|
||||
120 => Ok(Call::Clone),
|
||||
158 => Ok(Call::SchedYield),
|
||||
183 => Ok(Call::GetCwd),
|
||||
_ => Err(Error::NoCall)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue