File tree 3 files changed +20
-4
lines changed
src/unix/bsd/freebsdlike/freebsd
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) {
1764
1764
_ => cfg. define ( "_WANT_FREEBSD11_STAT" , None ) ,
1765
1765
} ;
1766
1766
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 ,
1769
1774
_ => false ,
1770
1775
} ;
1771
1776
@@ -1818,10 +1823,11 @@ fn test_freebsd(target: &str) {
1818
1823
"stdlib.h" ,
1819
1824
"string.h" ,
1820
1825
"sys/capsicum.h" ,
1821
- [ freebsdlast ] : "sys/auxv.h" ,
1826
+ [ freebsd12 ] : "sys/auxv.h" ,
1822
1827
"sys/cpuset.h" ,
1823
- [ freebsdlast ] : "sys/domainset.h" ,
1828
+ [ freebsd12 ] : "sys/domainset.h" ,
1824
1829
"sys/event.h" ,
1830
+ [ freebsd13] : "sys/eventfd.h" ,
1825
1831
"sys/extattr.h" ,
1826
1832
"sys/file.h" ,
1827
1833
"sys/ioctl.h" ,
@@ -1914,6 +1920,9 @@ fn test_freebsd(target: &str) {
1914
1920
true
1915
1921
}
1916
1922
1923
+ // These constants were introduced in FreeBSD 13:
1924
+ "EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some ( 13 ) > freebsd_ver => true ,
1925
+
1917
1926
// These constants were introduced in FreeBSD 12:
1918
1927
"SF_USER_READAHEAD"
1919
1928
| "EVFILT_EMPTY"
Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ extern "C" {
265
265
rmtp : * mut :: timespec ,
266
266
) -> :: c_int ;
267
267
268
+ pub fn eventfd ( init : :: c_uint , flags : :: c_int ) -> :: c_int ;
269
+
268
270
pub fn fdatasync ( fd : :: c_int ) -> :: c_int ;
269
271
270
272
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;
1717
1717
pub const RFTSIGZMB : :: c_int = 524288 ;
1718
1718
pub const RFSPAWN : :: c_int = 2147483648 ;
1719
1719
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
+
1720
1725
pub const MALLOCX_ZERO : :: c_int = 0x40 ;
1721
1726
1722
1727
/// size of returned wchan message
You can’t perform that action at this time.
0 commit comments