Skip to content

Commit

Permalink
Auto merge of #3150 - valpackett:kq, r=JohnTitor
Browse files Browse the repository at this point in the history
Add missing kqueue constants across BSDs

While here, reorder some to match the C headers
  • Loading branch information
bors committed Apr 2, 2023
2 parents 26c13fd + b3853e8 commit 5c57d3e
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 5 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,9 @@ fn test_freebsd(target: &str) {
// FIXME: Removed in https://reviews.freebsd.org/D39127.
"KERN_VNODE" => true,

// Added in FreeBSD 14
"EV_KEEPUDATA" if Some(14) > freebsd_ver => true,

_ => false,
}
});
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 @@ -269,6 +269,7 @@ EV_ENABLE
EV_EOF
EV_ERROR
EV_FLAG1
EV_HUP
EV_NODATA
EV_ONESHOT
EV_RECEIPT
Expand Down
9 changes: 9 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ EV_ENABLE
EV_EOF
EV_ERROR
EV_FLAG1
EV_FLAG2
EV_FORCEONESHOT
EV_KEEPUDATA
EV_ONESHOT
EV_RECEIPT
EV_SYSFLAGS
Expand Down Expand Up @@ -791,8 +794,11 @@ NI_NUMERICSERV
NOEXPR
NOKERNINFO
NOSTR
NOTE_ABSTIME
NOTE_ATTRIB
NOTE_CHILD
NOTE_CLOSE
NOTE_CLOSE_WRITE
NOTE_DELETE
NOTE_EXEC
NOTE_EXIT
Expand All @@ -803,13 +809,16 @@ NOTE_FFCTRLMASK
NOTE_FFLAGSMASK
NOTE_FFNOP
NOTE_FFOR
NOTE_FILE_POLL
NOTE_FORK
NOTE_LINK
NOTE_LOWAT
NOTE_MSECONDS
NOTE_NSECONDS
NOTE_OPEN
NOTE_PCTRLMASK
NOTE_PDATAMASK
NOTE_READ
NOTE_RENAME
NOTE_REVOKE
NOTE_SECONDS
Expand Down
7 changes: 7 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ NOTE_DELETE
NOTE_EXEC
NOTE_EXIT
NOTE_EXTEND
NOTE_FFAND
NOTE_FFCOPY
NOTE_FFCTRLMASK
NOTE_FFLAGSMASK
NOTE_FFNOP
NOTE_FFOR
NOTE_FORK
NOTE_LINK
NOTE_LOWAT
Expand All @@ -741,6 +747,7 @@ NOTE_RENAME
NOTE_REVOKE
NOTE_TRACK
NOTE_TRACKERR
NOTE_TRIGGER
NOTE_USECONDS
NOTE_WRITE
NTP_API
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ ESOCKTNOSUPPORT
ETOOMANYREFS
EUSERS
EVFILT_AIO
EVFILT_DEVICE
EVFILT_EXCEPT
EVFILT_PROC
EVFILT_READ
EVFILT_SIGNAL
Expand Down Expand Up @@ -582,6 +584,7 @@ NOEXPR
NOKERNINFO
NOSTR
NOTE_ATTRIB
NOTE_CHANGE
NOTE_CHILD
NOTE_DELETE
NOTE_EOF
Expand All @@ -591,6 +594,7 @@ NOTE_EXTEND
NOTE_FORK
NOTE_LINK
NOTE_LOWAT
NOTE_OOB
NOTE_PCTRLMASK
NOTE_PDATAMASK
NOTE_RENAME
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ pub const EV_NODATA: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
pub const EV_HUP: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;

pub const FIODNAME: ::c_ulong = 0x80106678;
Expand Down
15 changes: 13 additions & 2 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2693,15 +2693,20 @@ pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
pub const EV_FORCEONESHOT: u16 = 0x100;
pub const EV_KEEPUDATA: u16 = 0x200;

pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const EV_DROP: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_FLAG2: u16 = 0x4000;

pub const EV_EOF: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const EV_ERROR: u16 = 0x4000;

pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
Expand All @@ -2711,13 +2716,18 @@ pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_FILE_POLL: u32 = 0x00000002;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
pub const NOTE_OPEN: u32 = 0x00000080;
pub const NOTE_CLOSE: u32 = 0x00000100;
pub const NOTE_CLOSE_WRITE: u32 = 0x00000200;
pub const NOTE_READ: u32 = 0x00000400;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
Expand All @@ -2730,6 +2740,7 @@ pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_MSECONDS: u32 = 0x00000002;
pub const NOTE_USECONDS: u32 = 0x00000004;
pub const NOTE_NSECONDS: u32 = 0x00000008;
pub const NOTE_ABSTIME: u32 = 0x00000010;

pub const MADV_PROTECT: ::c_int = 10;

Expand Down
7 changes: 7 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1986,6 +1986,13 @@ pub const EV_ERROR: u32 = 0x4000;
pub const EV_EOF: u32 = 0x8000;
pub const EV_SYSFLAGS: u32 = 0xf000;

pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
pub const NOTE_FFOR: u32 = 0x80000000;
pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
Expand Down
10 changes: 7 additions & 3 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,13 +1279,15 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;

pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_DEVICE: i16 = -8;
pub const EVFILT_EXCEPT: i16 = -9;

pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
Expand All @@ -1304,6 +1306,7 @@ pub const EV_SYSFLAGS: u16 = 0xf800;

pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_EOF: u32 = 0x00000002;
pub const NOTE_OOB: u32 = 0x00000004;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
Expand All @@ -1320,6 +1323,7 @@ pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
pub const NOTE_CHANGE: u32 = 0x00000001;

pub const TMP_MAX: ::c_uint = 0x7fffffff;

Expand Down

0 comments on commit 5c57d3e

Please sign in to comment.