File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
src/unix/bsd/freebsdlike/freebsd Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1764,8 +1764,13 @@ fn test_freebsd(target: &str) {
17641764 _ => cfg. define ( "_WANT_FREEBSD11_STAT" , None ) ,
17651765 } ;
17661766
1767- let freebsdlast = match freebsd_ver {
1768- Some ( 12 ) | Some ( 13 ) => true ,
1767+ let freebsd12 = match freebsd_ver {
1768+ Some ( n) if n >= 12 => true ,
1769+ _ => false ,
1770+ } ;
1771+
1772+ let freebsd13 = match freebsd_ver {
1773+ Some ( n) if n >= 13 => true ,
17691774 _ => false ,
17701775 } ;
17711776
@@ -1818,10 +1823,11 @@ fn test_freebsd(target: &str) {
18181823 "stdlib.h" ,
18191824 "string.h" ,
18201825 "sys/capsicum.h" ,
1821- [ freebsdlast ] : "sys/auxv.h" ,
1826+ [ freebsd12 ] : "sys/auxv.h" ,
18221827 "sys/cpuset.h" ,
1823- [ freebsdlast ] : "sys/domainset.h" ,
1828+ [ freebsd12 ] : "sys/domainset.h" ,
18241829 "sys/event.h" ,
1830+ [ freebsd13] : "sys/eventfd.h" ,
18251831 "sys/extattr.h" ,
18261832 "sys/file.h" ,
18271833 "sys/ioctl.h" ,
@@ -1914,6 +1920,9 @@ fn test_freebsd(target: &str) {
19141920 true
19151921 }
19161922
1923+ // These constants were introduced in FreeBSD 13:
1924+ "EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some ( 13 ) > freebsd_ver => true ,
1925+
19171926 // These constants were introduced in FreeBSD 12:
19181927 "SF_USER_READAHEAD"
19191928 | "EVFILT_EMPTY"
Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ extern "C" {
265265 rmtp : * mut :: timespec ,
266266 ) -> :: c_int ;
267267
268+ pub fn eventfd ( init : :: c_uint , flags : :: c_int ) -> :: c_int ;
269+
268270 pub fn fdatasync ( fd : :: c_int ) -> :: c_int ;
269271
270272 pub fn getrandom ( buf : * mut :: c_void , buflen : :: size_t , flags : :: c_uint ) -> :: ssize_t ;
Original file line number Diff line number Diff line change @@ -1717,6 +1717,11 @@ pub const RFLINUXTHPN: ::c_int = 65536;
17171717pub const RFTSIGZMB : :: c_int = 524288 ;
17181718pub const RFSPAWN : :: c_int = 2147483648 ;
17191719
1720+ // For eventfd
1721+ pub const EFD_SEMAPHORE : :: c_int = 0x1 ;
1722+ pub const EFD_NONBLOCK : :: c_int = 0x4 ;
1723+ pub const EFD_CLOEXEC : :: c_int = 0x100000 ;
1724+
17201725pub const MALLOCX_ZERO : :: c_int = 0x40 ;
17211726
17221727/// size of returned wchan message
You can’t perform that action at this time.
0 commit comments