Browse Source

signal: sigaction struct should not be a typedef

The sigaction struct should not be a typedef, but the sigset_t struct
should be a typedef.
Dan Robertson 7 years ago
parent
commit
f1d802dc1e

+ 0 - 10
include/bits/signal.h

@@ -1,10 +0,0 @@
-#ifndef _BITS_SIGNAL_H
-#define _BITS_SIGNAL_H
-
-typedef struct sigaction {
-  void (*sa_handler)(uintptr_t);
-  sigset_t sa_mask;
-  uintptr_t sa_flags;
-};
-
-#endif

+ 1 - 1
src/signal/cbindgen.toml

@@ -1,6 +1,6 @@
 sys_includes = ["sys/types.h"]
 include_guard = "_SIGNAL_H"
-trailer = "#include <bits/signal.h>"
+style = "Tag"
 language = "C"
 
 [defines]

+ 2 - 0
src/signal/src/lib.rs

@@ -23,6 +23,8 @@ pub struct sigaction {
     pub sa_flags: usize,
 }
 
+pub type sigset_t = sys_sigset_t;
+
 #[no_mangle]
 pub extern "C" fn kill(pid: pid_t, sig: c_int) -> c_int {
     unimplemented!();

+ 1 - 1
src/signal/src/linux.rs

@@ -1,5 +1,5 @@
 #[repr(C)]
-pub struct sigset_t {
+pub struct sys_sigset_t {
     pub bits: [u64; 16],
 }
 

+ 1 - 1
src/signal/src/redox.rs

@@ -1,5 +1,5 @@
 #[repr(C)]
-pub struct sigset_t {
+pub struct sys_sigset_t {
     pub bits: [u64; 2],
 }
 

+ 1 - 0
src/wait/cbindgen.toml

@@ -1,5 +1,6 @@
 sys_includes = ["sys/types.h", "sys/resource.h"]
 include_guard = "_SYS_WAIT_H"
+style = "Tag"
 language = "C"
 
 [enum]