Skip to content
Snippets Groups Projects
Verified Commit 284f51b4 authored by Jacob Lorentzon's avatar Jacob Lorentzon
Browse files

Fix struct sigaction defintion.

parent cf390d6a
No related branches found
No related tags found
1 merge request!480Refactor redox runtime and impl signals in userspace
...@@ -5,4 +5,18 @@ ...@@ -5,4 +5,18 @@
#define SIG_IGN ((void (*)(int))1) #define SIG_IGN ((void (*)(int))1)
#define SIG_ERR ((void (*)(int))-1) #define SIG_ERR ((void (*)(int))-1)
struct siginfo;
typedef struct siginfo siginfo_t;
typedef unsigned long long sigset_t;
struct sigaction {
union {
void (*sa_handler)(int);
void (*sa_sigaction)(int, siginfo_t *, void *);
};
unsigned long sa_flags;
void (*sa_restorer)(void);
sigset_t sa_mask;
};
#endif // _BITS_SIGNAL_H #endif // _BITS_SIGNAL_H
sys_includes = ["stdint.h", "sys/types.h", "time.h", "bits/pthread.h"] sys_includes = ["bits/signal.h", "stdint.h", "sys/types.h", "time.h", "bits/pthread.h"]
include_guard = "_RELIBC_SIGNAL_H" include_guard = "_RELIBC_SIGNAL_H"
trailer = "#include <bits/signal.h>" trailer = "#include <bits/signal.h>"
language = "C" language = "C"
...@@ -15,3 +15,4 @@ prefix_with_name = true ...@@ -15,3 +15,4 @@ prefix_with_name = true
[export.rename] [export.rename]
"timespec" = "struct timespec" "timespec" = "struct timespec"
"sigaction" = "struct sigaction"
...@@ -35,6 +35,7 @@ pub const SIG_SETMASK: c_int = 2; ...@@ -35,6 +35,7 @@ pub const SIG_SETMASK: c_int = 2;
#[repr(C)] #[repr(C)]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
/// cbindgen:ignore
pub struct sigaction { pub struct sigaction {
pub sa_handler: Option<extern "C" fn(c_int)>, pub sa_handler: Option<extern "C" fn(c_int)>,
pub sa_flags: c_ulong, pub sa_flags: c_ulong,
...@@ -52,7 +53,7 @@ pub struct sigaltstack { ...@@ -52,7 +53,7 @@ pub struct sigaltstack {
#[repr(C)] #[repr(C)]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct siginfo_t { pub struct siginfo {
pub si_signo: c_int, pub si_signo: c_int,
pub si_errno: c_int, pub si_errno: c_int,
pub si_code: c_int, pub si_code: c_int,
...@@ -60,7 +61,10 @@ pub struct siginfo_t { ...@@ -60,7 +61,10 @@ pub struct siginfo_t {
_si_align: [usize; 0], _si_align: [usize; 0],
} }
/// cbindgen:ignore
pub type sigset_t = c_ulonglong; pub type sigset_t = c_ulonglong;
/// cbindgen:ignore
pub type siginfo_t = siginfo;
pub type stack_t = sigaltstack; pub type stack_t = sigaltstack;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment