Skip to content

Commit 621a3c2

Browse files
committed
linux seccomp extension for glibc
1 parent 172ebd0 commit 621a3c2

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

src/unix/linux_like/linux/gnu/b32/arm/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ s! {
161161
pub ss_flags: ::c_int,
162162
pub ss_size: ::size_t
163163
}
164+
165+
pub struct seccomp_notif_sizes {
166+
pub seccomp_notif: ::__u16,
167+
pub seccomp_notif_resp: ::__u16,
168+
pub seccomp_data: ::__u16,
169+
}
164170
}
165171

166172
pub const RLIM_INFINITY: ::rlim_t = !0;
@@ -424,6 +430,11 @@ pub const B3000000: ::speed_t = 0o010015;
424430
pub const B3500000: ::speed_t = 0o010016;
425431
pub const B4000000: ::speed_t = 0o010017;
426432

433+
pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
434+
pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
435+
pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
436+
pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
437+
427438
pub const VEOL: usize = 11;
428439
pub const VEOL2: usize = 16;
429440
pub const VMIN: usize = 6;

src/unix/linux_like/linux/gnu/b32/x86/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ s! {
235235
pub ss_flags: ::c_int,
236236
pub ss_size: ::size_t
237237
}
238+
239+
pub struct seccomp_notif_sizes {
240+
pub seccomp_notif: ::__u16,
241+
pub seccomp_notif_resp: ::__u16,
242+
pub seccomp_data: ::__u16,
243+
}
238244
}
239245

240246
s_no_extra_traits! {
@@ -1115,6 +1121,11 @@ pub const REG_EFL: ::c_int = 16;
11151121
pub const REG_UESP: ::c_int = 17;
11161122
pub const REG_SS: ::c_int = 18;
11171123

1124+
pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
1125+
pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
1126+
pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
1127+
pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
1128+
11181129
extern "C" {
11191130
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
11201131
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;

src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ s! {
194194
pub imr_address: ::in_addr,
195195
pub imr_ifindex: ::c_int,
196196
}
197+
198+
pub struct seccomp_notif_sizes {
199+
pub seccomp_notif: ::__u16,
200+
pub seccomp_notif_resp: ::__u16,
201+
pub seccomp_data: ::__u16,
202+
}
197203
}
198204

199205
pub const VEOF: usize = 4;
@@ -526,6 +532,11 @@ pub const B3000000: ::speed_t = 0o010015;
526532
pub const B3500000: ::speed_t = 0o010016;
527533
pub const B4000000: ::speed_t = 0o010017;
528534

535+
pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
536+
pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
537+
pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
538+
pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
539+
529540
pub const VEOL: usize = 11;
530541
pub const VEOL2: usize = 16;
531542
pub const VMIN: usize = 6;

src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ s! {
264264
pub imr_address: ::in_addr,
265265
pub imr_ifindex: ::c_int,
266266
}
267+
268+
pub struct seccomp_notif_sizes {
269+
pub seccomp_notif: ::__u16,
270+
pub seccomp_notif_resp: ::__u16,
271+
pub seccomp_data: ::__u16,
272+
}
267273
}
268274

269275
s_no_extra_traits! {
@@ -820,6 +826,11 @@ pub const REG_TRAPNO: ::c_int = 20;
820826
pub const REG_OLDMASK: ::c_int = 21;
821827
pub const REG_CR2: ::c_int = 22;
822828

829+
pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
830+
pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
831+
pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
832+
pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
833+
823834
extern "C" {
824835
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
825836
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;

0 commit comments

Comments
 (0)