Commit f3c97bee authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add signal flags

parent 743b0919
......@@ -256,6 +256,11 @@ pub fn setreuid(ruid: usize, euid: usize) -> Result<usize> {
unsafe { syscall2(SYS_SETREUID, ruid, euid) }
}
/// Set up a signal handler
pub fn signal(sig: usize, handler: extern fn(usize)) -> Result<usize> {
unsafe { syscall2(SYS_SIGNAL, sig, handler as usize) }
}
/// Remove a file
pub fn unlink<T: AsRef<[u8]>>(path: T) -> Result<usize> {
unsafe { syscall2(SYS_UNLINK, path.as_ref().as_ptr() as usize, path.as_ref().len()) }
......
pub const CLONE_VM: usize = 0x100;
pub const CLONE_FS: usize = 0x200;
pub const CLONE_FILES: usize = 0x400;
pub const CLONE_SIGHAND: usize = 0x800;
pub const CLONE_VFORK: usize = 0x4000;
pub const CLOCK_REALTIME: usize = 1;
......@@ -84,4 +85,7 @@ pub const SIGIO: usize = 29;
pub const SIGPWR: usize = 30;
pub const SIGSYS: usize = 31;
pub const SIG_DFL: usize = 0;
pub const SIG_IGN: usize = 1;
pub const WNOHANG: usize = 1;
......@@ -61,5 +61,6 @@ pub const SYS_PIPE2: usize = 331;
pub const SYS_SETREGID: usize = 204;
pub const SYS_SETRENS: usize = 952;
pub const SYS_SETREUID: usize = 203;
pub const SYS_SIGNAL: usize = 48;
pub const SYS_WAITPID: usize = 7;
pub const SYS_YIELD: usize = 158;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment