Skip to content

Fix seccomp constants on musl/all linux platforms #3342

Closed
@boustrophedon

Description

@boustrophedon

on x86_64-unknown-linux-gnu, some of the seccomp-related constants are provided but they are not on all platforms.

These constants live inside <linux/seccomp.h> and it appears that some of them exist in rust's libc linux/mod.rs
Linux: https://github.com/torvalds/linux/blob/master/include/uapi/linux/seccomp.h#L10
Rust libc linux/mod.rs:

pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;

Rust libc linux/gnu//mod.rs
pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;

The constants

/* Valid operations for seccomp syscall. */
#define SECCOMP_SET_MODE_STRICT		0
#define SECCOMP_SET_MODE_FILTER		1
#define SECCOMP_GET_ACTION_AVAIL	2
#define SECCOMP_GET_NOTIF_SIZES		3

from seccomp.h appear to be missing from unix/linux_like/linux/mod.rs . Some other newer constants also appear to be missing e.g. SECCOMP_FILTER_FLAG_NEW_LISTENER.

If it seems okay to move everything into linux/mod.rs, I'll make a PR for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions