Fix struct sigaction defintion.

This commit is contained in:
4lDO2
2024-07-04 11:31:45 +02:00
parent cf390d6a52
commit 284f51b47e
3 changed files with 21 additions and 2 deletions
+14
View File
@@ -5,4 +5,18 @@
#define SIG_IGN ((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
+2 -1
View File
@@ -1,4 +1,4 @@
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"
trailer = "#include <bits/signal.h>"
language = "C"
@@ -15,3 +15,4 @@ prefix_with_name = true
[export.rename]
"timespec" = "struct timespec"
"sigaction" = "struct sigaction"
+5 -1
View File
@@ -35,6 +35,7 @@ pub const SIG_SETMASK: c_int = 2;
#[repr(C)]
#[derive(Clone, Debug)]
/// cbindgen:ignore
pub struct sigaction {
pub sa_handler: Option<extern "C" fn(c_int)>,
pub sa_flags: c_ulong,
@@ -52,7 +53,7 @@ pub struct sigaltstack {
#[repr(C)]
#[derive(Clone, Debug)]
pub struct siginfo_t {
pub struct siginfo {
pub si_signo: c_int,
pub si_errno: c_int,
pub si_code: c_int,
@@ -60,7 +61,10 @@ pub struct siginfo_t {
_si_align: [usize; 0],
}
/// cbindgen:ignore
pub type sigset_t = c_ulonglong;
/// cbindgen:ignore
pub type siginfo_t = siginfo;
pub type stack_t = sigaltstack;