Skip to content
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
1 change: 1 addition & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ BIOCSSEESENT
BIOCVERSION
BOOT_TIME
BPF_ALIGNMENT
BPF_WORDALIGN
BS0
BS1
BSDLY
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ BIOCSSEESENT
BIOCVERSION
BOOT_TIME
BPF_ALIGNMENT
BPF_WORDALIGN
BTUARTDISC
BUFSIZ
BUS_ADRALN
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ BIOCSSEESENT
BIOCVERSION
BOOT_TIME
BPF_ALIGNMENT
BPF_WORDALIGN
BUFSIZ
BUS_ADRALN
BUS_ADRERR
Expand Down
4 changes: 4 additions & 0 deletions src/new/apple/xnu/net/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ pub const DLT_LOOP: c_uint = 108;

pub const BPF_ALIGNMENT: c_int = size_of::<i32>() as c_int;

pub const fn BPF_WORDALIGN(x: usize) -> usize {
(x + (BPF_ALIGNMENT as usize - 1)) & !(BPF_ALIGNMENT as usize - 1)
}

pub const BIOCGRSIG: c_ulong = _IOR::<c_uint>('B' as c_ulong, 114);
pub const BIOCSRSIG: c_ulong = _IOW::<c_uint>('B' as c_ulong, 115);
pub const BIOCGSEESENT: c_ulong = _IOR::<c_uint>('B' as c_ulong, 118);
Expand Down
4 changes: 4 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,10 @@ pub const EUI64_LEN: usize = 8;
// https://github.com/freebsd/freebsd/blob/HEAD/sys/net/bpf.h
pub const BPF_ALIGNMENT: usize = SIZEOF_LONG;

pub const fn BPF_WORDALIGN(x: usize) -> usize {
(x + (BPF_ALIGNMENT - 1)) & !(BPF_ALIGNMENT - 1)
}

// Values for rtprio struct (prio field) and syscall (function argument)
pub const RTP_PRIO_MIN: c_ushort = 0;
pub const RTP_PRIO_MAX: c_ushort = 31;
Expand Down