File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,3 +357,25 @@ struct mmsghdr {
357357#define MNT_EXPIRE 0x4
358358#define UMOUNT_NOFOLLOW 0x8
359359#define UMOUNT_UNUSED 0x80000000
360+
361+ // Linux's public headers provide public `NSIG`, `sigset_t` and `sigaction`
362+ // definitions which "cater to libcs that poke about in kernel headers", but
363+ // they're not usable in libcs because, for example, `SYS_rt_sigaction` insists
364+ // that its fourth argument be the size of the kernel's internal `sigset_t`
365+ // type. So we define our own.
366+
367+ #if defined(__i386__ ) || defined(__x86_64__ ) || defined(__s390x__ ) || defined(__arm__ )
368+ #define _NSIG 64
369+ #endif
370+
371+ typedef struct {
372+ unsigned long sig [_NSIG / (sizeof (unsigned long ) * __CHAR_BIT__ )];
373+ } kernel_sigset_t ;
374+
375+ struct kernel_sigaction {
376+ // Some platforms make `sa_handler` a macro, so use a different name.
377+ __kernel_sighandler_t sa_handler_kernel ;
378+ unsigned long sa_flags ;
379+ __sigrestore_t sa_restorer ;
380+ kernel_sigset_t sa_mask ;
381+ };
Original file line number Diff line number Diff line change @@ -5254,3 +5254,16 @@ pub struct mmsghdr {
52545254pub msg_hdr : msghdr ,
52555255pub msg_len : crate :: ctypes:: c_uint ,
52565256}
5257+ #[ repr( C ) ]
5258+ #[ derive( Debug , Copy , Clone ) ]
5259+ pub struct kernel_sigset_t {
5260+ pub sig : [ crate :: ctypes:: c_ulong ; 1usize ] ,
5261+ }
5262+ #[ repr( C ) ]
5263+ #[ derive( Debug , Copy , Clone ) ]
5264+ pub struct kernel_sigaction {
5265+ pub sa_handler_kernel : __kernel_sighandler_t ,
5266+ pub sa_flags : crate :: ctypes:: c_ulong ,
5267+ pub sa_restorer : __sigrestore_t ,
5268+ pub sa_mask : kernel_sigset_t ,
5269+ }
Original file line number Diff line number Diff line change @@ -2614,6 +2614,7 @@ pub const MNT_DETACH: u32 = 2;
26142614pub const MNT_EXPIRE : u32 = 4 ;
26152615pub const UMOUNT_NOFOLLOW : u32 = 8 ;
26162616pub const UMOUNT_UNUSED : u32 = 2147483648 ;
2617+ pub const _NSIG: u32 = 64 ;
26172618pub type size_t = crate :: ctypes:: c_uint ;
26182619pub type ssize_t = crate :: ctypes:: c_int ;
26192620pub type __s8 = crate :: ctypes:: c_schar ;
@@ -5377,3 +5378,16 @@ pub struct mmsghdr {
53775378pub msg_hdr : msghdr ,
53785379pub msg_len : crate :: ctypes:: c_uint ,
53795380}
5381+ #[ repr( C ) ]
5382+ #[ derive( Debug , Copy , Clone ) ]
5383+ pub struct kernel_sigset_t {
5384+ pub sig : [ crate :: ctypes:: c_ulong ; 2usize ] ,
5385+ }
5386+ #[ repr( C ) ]
5387+ #[ derive( Debug , Copy , Clone ) ]
5388+ pub struct kernel_sigaction {
5389+ pub sa_handler_kernel : __kernel_sighandler_t ,
5390+ pub sa_flags : crate :: ctypes:: c_ulong ,
5391+ pub sa_restorer : __sigrestore_t ,
5392+ pub sa_mask : kernel_sigset_t ,
5393+ }
Original file line number Diff line number Diff line change @@ -5542,3 +5542,16 @@ pub struct mmsghdr {
55425542pub msg_hdr : msghdr ,
55435543pub msg_len : crate :: ctypes:: c_uint ,
55445544}
5545+ #[ repr( C ) ]
5546+ #[ derive( Debug , Copy , Clone ) ]
5547+ pub struct kernel_sigset_t {
5548+ pub sig : [ crate :: ctypes:: c_ulong ; 4usize ] ,
5549+ }
5550+ #[ repr( C ) ]
5551+ #[ derive( Debug , Copy , Clone ) ]
5552+ pub struct kernel_sigaction {
5553+ pub sa_handler_kernel : __kernel_sighandler_t ,
5554+ pub sa_flags : crate :: ctypes:: c_ulong ,
5555+ pub sa_restorer : __sigrestore_t ,
5556+ pub sa_mask : kernel_sigset_t ,
5557+ }
Original file line number Diff line number Diff line change @@ -5467,3 +5467,16 @@ pub struct mmsghdr {
54675467pub msg_hdr : msghdr ,
54685468pub msg_len : crate :: ctypes:: c_uint ,
54695469}
5470+ #[ repr( C ) ]
5471+ #[ derive( Debug , Copy , Clone ) ]
5472+ pub struct kernel_sigset_t {
5473+ pub sig : [ crate :: ctypes:: c_ulong ; 2usize ] ,
5474+ }
5475+ #[ repr( C ) ]
5476+ #[ derive( Debug , Copy , Clone ) ]
5477+ pub struct kernel_sigaction {
5478+ pub sa_handler_kernel : __kernel_sighandler_t ,
5479+ pub sa_flags : crate :: ctypes:: c_ulong ,
5480+ pub sa_restorer : __sigrestore_t ,
5481+ pub sa_mask : kernel_sigset_t ,
5482+ }
Original file line number Diff line number Diff line change @@ -5463,3 +5463,16 @@ pub struct mmsghdr {
54635463pub msg_hdr : msghdr ,
54645464pub msg_len : crate :: ctypes:: c_uint ,
54655465}
5466+ #[ repr( C ) ]
5467+ #[ derive( Debug , Copy , Clone ) ]
5468+ pub struct kernel_sigset_t {
5469+ pub sig : [ crate :: ctypes:: c_ulong ; 2usize ] ,
5470+ }
5471+ #[ repr( C ) ]
5472+ #[ derive( Debug , Copy , Clone ) ]
5473+ pub struct kernel_sigaction {
5474+ pub sa_handler_kernel : __kernel_sighandler_t ,
5475+ pub sa_flags : crate :: ctypes:: c_ulong ,
5476+ pub sa_restorer : __sigrestore_t ,
5477+ pub sa_mask : kernel_sigset_t ,
5478+ }
Original file line number Diff line number Diff line change @@ -5418,3 +5418,16 @@ pub struct mmsghdr {
54185418pub msg_hdr : msghdr ,
54195419pub msg_len : crate :: ctypes:: c_uint ,
54205420}
5421+ #[ repr( C ) ]
5422+ #[ derive( Debug , Copy , Clone ) ]
5423+ pub struct kernel_sigset_t {
5424+ pub sig : [ crate :: ctypes:: c_ulong ; 1usize ] ,
5425+ }
5426+ #[ repr( C ) ]
5427+ #[ derive( Debug , Copy , Clone ) ]
5428+ pub struct kernel_sigaction {
5429+ pub sa_handler_kernel : __kernel_sighandler_t ,
5430+ pub sa_flags : crate :: ctypes:: c_ulong ,
5431+ pub sa_restorer : __sigrestore_t ,
5432+ pub sa_mask : kernel_sigset_t ,
5433+ }
Original file line number Diff line number Diff line change @@ -5262,3 +5262,16 @@ pub struct mmsghdr {
52625262pub msg_hdr : msghdr ,
52635263pub msg_len : crate :: ctypes:: c_uint ,
52645264}
5265+ #[ repr( C ) ]
5266+ #[ derive( Debug , Copy , Clone ) ]
5267+ pub struct kernel_sigset_t {
5268+ pub sig : [ crate :: ctypes:: c_ulong ; 2usize ] ,
5269+ }
5270+ #[ repr( C ) ]
5271+ #[ derive( Debug , Copy , Clone ) ]
5272+ pub struct kernel_sigaction {
5273+ pub sa_handler_kernel : __kernel_sighandler_t ,
5274+ pub sa_flags : crate :: ctypes:: c_ulong ,
5275+ pub sa_restorer : __sigrestore_t ,
5276+ pub sa_mask : kernel_sigset_t ,
5277+ }
Original file line number Diff line number Diff line change @@ -5255,3 +5255,16 @@ pub struct mmsghdr {
52555255pub msg_hdr : msghdr ,
52565256pub msg_len : crate :: ctypes:: c_uint ,
52575257}
5258+ #[ repr( C ) ]
5259+ #[ derive( Debug , Copy , Clone ) ]
5260+ pub struct kernel_sigset_t {
5261+ pub sig : [ crate :: ctypes:: c_ulong ; 1usize ] ,
5262+ }
5263+ #[ repr( C ) ]
5264+ #[ derive( Debug , Copy , Clone ) ]
5265+ pub struct kernel_sigaction {
5266+ pub sa_handler_kernel : __kernel_sighandler_t ,
5267+ pub sa_flags : crate :: ctypes:: c_ulong ,
5268+ pub sa_restorer : __sigrestore_t ,
5269+ pub sa_mask : kernel_sigset_t ,
5270+ }
Original file line number Diff line number Diff line change @@ -2572,6 +2572,7 @@ pub const MNT_DETACH: u32 = 2;
25722572pub const MNT_EXPIRE : u32 = 4 ;
25732573pub const UMOUNT_NOFOLLOW : u32 = 8 ;
25742574pub const UMOUNT_UNUSED : u32 = 2147483648 ;
2575+ pub const _NSIG: u32 = 64 ;
25752576pub type size_t = crate :: ctypes:: c_ulong ;
25762577pub type ssize_t = crate :: ctypes:: c_long ;
25772578pub type __s8 = crate :: ctypes:: c_schar ;
@@ -5295,3 +5296,16 @@ pub struct mmsghdr {
52955296pub msg_hdr : msghdr ,
52965297pub msg_len : crate :: ctypes:: c_uint ,
52975298}
5299+ #[ repr( C ) ]
5300+ #[ derive( Debug , Copy , Clone ) ]
5301+ pub struct kernel_sigset_t {
5302+ pub sig : [ crate :: ctypes:: c_ulong ; 1usize ] ,
5303+ }
5304+ #[ repr( C ) ]
5305+ #[ derive( Debug , Copy , Clone ) ]
5306+ pub struct kernel_sigaction {
5307+ pub sa_handler_kernel : __kernel_sighandler_t ,
5308+ pub sa_flags : crate :: ctypes:: c_ulong ,
5309+ pub sa_restorer : __sigrestore_t ,
5310+ pub sa_mask : kernel_sigset_t ,
5311+ }
You can’t perform that action at this time.
0 commit comments