Skip to content

Fix the type of file flags on OpenBSD #2841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,6 @@ pub const TIOCM_DSR: ::c_int = 0o0400;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;

// Flags for chflags(2)
pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
pub const UF_NODUMP: ::c_ulong = 0x00000001;
pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
pub const UF_APPEND: ::c_ulong = 0x00000004;
pub const UF_OPAQUE: ::c_ulong = 0x00000008;
pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
pub const SF_APPEND: ::c_ulong = 0x00040000;

pub const TIMER_ABSTIME: ::c_int = 1;

#[link(name = "util")]
Expand Down
11 changes: 10 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2228,9 +2228,18 @@ pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40;

// Flags for chflags(2)
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
pub const SF_APPEND: ::c_ulong = 0x00040000;
pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
pub const SF_LOG: ::c_ulong = 0x00400000;
pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
pub const SF_SNAPINVAL: ::c_ulong = 0x00800000;
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
pub const UF_APPEND: ::c_ulong = 0x00000004;
pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
pub const UF_NODUMP: ::c_ulong = 0x00000001;
pub const UF_OPAQUE: ::c_ulong = 0x00000008;
pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;

// sys/sysctl.h
pub const KVME_PROT_READ: ::c_int = 0x00000001;
Expand Down
11 changes: 11 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,17 @@ pub const EPROC_SLEADER: i32 = 0x02; // session leader
pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings
pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked

// Flags for chflags(2)
pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
pub const UF_NODUMP: ::c_uint = 0x00000001;
pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
pub const UF_APPEND: ::c_uint = 0x00000004;
pub const UF_OPAQUE: ::c_uint = 0x00000008;
pub const SF_SETTABLE: ::c_uint = 0xffff0000;
pub const SF_ARCHIVED: ::c_uint = 0x00010000;
pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
pub const SF_APPEND: ::c_uint = 0x00040000;

const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
Expand Down