@@ -310,6 +310,32 @@ cfg_if! {
310310 }
311311}
312312
313+ cfg_if ! {
314+ if #[ cfg( not( freebsd10) ) ] {
315+ // These constants are not available in FreeBSD10
316+ // This prevents them from being used from libstd:
317+ pub const SF_USER_READAHEAD : :: c_int = 0x00000008 ;
318+ pub const SF_NOCACHE : :: c_int = 0x00000010 ;
319+ pub const RLIMIT_KQUEUES : :: c_int = 13 ;
320+ pub const RLIMIT_UMTXP : :: c_int = 14 ;
321+ pub const EVFILT_PROCDESC : i16 = -8 ;
322+ pub const EVFILT_SENDFILE : i16 = -12 ;
323+ pub const EVFILT_EMPTY : i16 = -13 ;
324+ pub const SO_REUSEPORT_LB : :: c_int = 0x10000 ;
325+ pub const TCP_CCALGOOPT : :: c_int = 65 ;
326+ pub const TCP_PCAP_OUT : :: c_int = 2048 ;
327+ pub const TCP_PCAP_IN : :: c_int = 4096 ;
328+ pub const IP_BINDMULTI : :: c_int = 25 ;
329+ pub const IP_ORIGDSTADDR : :: c_int = 27 ;
330+ pub const IP_RECVORIGDSTADDR : :: c_int = IP_ORIGDSTADDR ;
331+ pub const IPV6_ORIGDSTADDR : :: c_int = 72 ;
332+ pub const IPV6_RECVORIGDSTADDR : :: c_int = IPV6_ORIGDSTADDR ;
333+ pub const PD_CLOEXEC : :: c_int = 0x00000002 ;
334+ pub const PD_ALLOWED_AT_FORK : :: c_int = PD_DAEMON | PD_CLOEXEC ;
335+ pub const IP_RSS_LISTEN_BUCKET : :: c_int = 26 ;
336+ }
337+ }
338+
313339pub const SIGEV_THREAD_ID : :: c_int = 4 ;
314340
315341pub const EXTATTR_NAMESPACE_EMPTY : :: c_int = 0 ;
@@ -323,8 +349,6 @@ pub const SIGSTKSZ: ::size_t = 34816;
323349pub const SF_NODISKIO : :: c_int = 0x00000001 ;
324350pub const SF_MNOWAIT : :: c_int = 0x00000002 ;
325351pub const SF_SYNC : :: c_int = 0x00000004 ;
326- pub const SF_USER_READAHEAD : :: c_int = 0x00000008 ;
327- pub const SF_NOCACHE : :: c_int = 0x00000010 ;
328352pub const O_CLOEXEC : :: c_int = 0x00100000 ;
329353pub const O_DIRECTORY : :: c_int = 0x00020000 ;
330354pub const O_EXEC : :: c_int = 0x00040000 ;
@@ -338,8 +362,6 @@ pub const ENOTRECOVERABLE: ::c_int = 95;
338362pub const EOWNERDEAD : :: c_int = 96 ;
339363pub const RLIMIT_NPTS : :: c_int = 11 ;
340364pub const RLIMIT_SWAP : :: c_int = 12 ;
341- pub const RLIMIT_KQUEUES : :: c_int = 13 ;
342- pub const RLIMIT_UMTXP : :: c_int = 14 ;
343365pub const RLIM_NLIMITS : :: rlim_t = 15 ;
344366
345367pub const Q_GETQUOTA : :: c_int = 0x700 ;
@@ -361,12 +383,9 @@ pub const EVFILT_VNODE: i16 = -4;
361383pub const EVFILT_PROC : i16 = -5 ;
362384pub const EVFILT_SIGNAL : i16 = -6 ;
363385pub const EVFILT_TIMER : i16 = -7 ;
364- pub const EVFILT_PROCDESC : i16 = -8 ;
365386pub const EVFILT_FS : i16 = -9 ;
366387pub const EVFILT_LIO : i16 = -10 ;
367388pub const EVFILT_USER : i16 = -11 ;
368- pub const EVFILT_SENDFILE : i16 = -12 ;
369- pub const EVFILT_EMPTY : i16 = -13 ;
370389
371390pub const EV_ADD : u16 = 0x1 ;
372391pub const EV_DELETE : u16 = 0x2 ;
@@ -593,7 +612,6 @@ pub const JAIL_SYS_INHERIT: ::c_int = 2;
593612pub const SO_BINTIME : :: c_int = 0x2000 ;
594613pub const SO_NO_OFFLOAD : :: c_int = 0x4000 ;
595614pub const SO_NO_DDP : :: c_int = 0x8000 ;
596- pub const SO_REUSEPORT_LB : :: c_int = 0x10000 ;
597615pub const SO_LABEL : :: c_int = 0x1009 ;
598616pub const SO_PEERLABEL : :: c_int = 0x1010 ;
599617pub const SO_LISTENQLIMIT : :: c_int = 0x1011 ;
@@ -932,23 +950,12 @@ pub const IPPROTO_SEND: ::c_int = 259;
932950pub const TCP_MD5SIG : :: c_int = 16 ;
933951pub const TCP_INFO : :: c_int = 32 ;
934952pub const TCP_CONGESTION : :: c_int = 64 ;
935- pub const TCP_CCALGOOPT : :: c_int = 65 ;
936953pub const TCP_KEEPINIT : :: c_int = 128 ;
937954pub const TCP_FASTOPEN : :: c_int = 1025 ;
938- pub const TCP_PCAP_OUT : :: c_int = 2048 ;
939- pub const TCP_PCAP_IN : :: c_int = 4096 ;
940955
941956pub const IP_BINDANY : :: c_int = 24 ;
942- pub const IP_BINDMULTI : :: c_int = 25 ;
943- pub const IP_RSS_LISTEN_BUCKET : :: c_int = 26 ;
944- pub const IP_ORIGDSTADDR : :: c_int = 27 ;
945- pub const IP_RECVORIGDSTADDR : :: c_int = IP_ORIGDSTADDR ;
946-
947957pub const IP_RECVTOS : :: c_int = 68 ;
948958
949- pub const IPV6_ORIGDSTADDR : :: c_int = 72 ;
950- pub const IPV6_RECVORIGDSTADDR : :: c_int = IPV6_ORIGDSTADDR ;
951-
952959pub const PF_SLOW : :: c_int = AF_SLOW ;
953960pub const PF_SCLUSTER : :: c_int = AF_SCLUSTER ;
954961pub const PF_ARP : :: c_int = AF_ARP ;
@@ -1071,8 +1078,6 @@ pub const XUCRED_VERSION: ::c_uint = 0;
10711078
10721079// Flags which can be passed to pdfork(2)
10731080pub const PD_DAEMON : :: c_int = 0x00000001 ;
1074- pub const PD_CLOEXEC : :: c_int = 0x00000002 ;
1075- pub const PD_ALLOWED_AT_FORK : :: c_int = PD_DAEMON | PD_CLOEXEC ;
10761081
10771082// Values for struct rtprio (type_ field)
10781083pub const RTP_PRIO_REALTIME : :: c_ushort = 2 ;
@@ -1138,6 +1143,14 @@ f! {
11381143 }
11391144}
11401145
1146+ #[ cfg( not( freebsd10) ) ]
1147+ extern {
1148+ pub fn fdatasync ( fd : :: c_int ) -> :: c_int ;
1149+ pub fn aio_waitcomplete ( iocbp : * mut * mut aiocb ,
1150+ timeout : * mut :: timespec ) -> :: ssize_t ;
1151+ pub fn mq_getfd_np ( mqd : :: mqd_t ) -> :: c_int ;
1152+ }
1153+
11411154extern {
11421155 pub fn __error ( ) -> * mut :: c_int ;
11431156
@@ -1205,7 +1218,6 @@ extern {
12051218 pub fn jail_set ( iov : * mut :: iovec , niov : :: c_uint , flags : :: c_int )
12061219 -> :: c_int ;
12071220
1208- pub fn fdatasync ( fd : :: c_int ) -> :: c_int ;
12091221 pub fn posix_fallocate ( fd : :: c_int , offset : :: off_t ,
12101222 len : :: off_t ) -> :: c_int ;
12111223 pub fn posix_fadvise ( fd : :: c_int , offset : :: off_t , len : :: off_t ,
@@ -1218,10 +1230,6 @@ extern {
12181230 pub fn getutxuser ( user : * const :: c_char ) -> * mut utmpx ;
12191231 pub fn setutxdb ( _type : :: c_int , file : * const :: c_char ) -> :: c_int ;
12201232
1221- pub fn aio_waitcomplete ( iocbp : * mut * mut aiocb ,
1222- timeout : * mut :: timespec ) -> :: ssize_t ;
1223- pub fn mq_getfd_np ( mqd : :: mqd_t ) -> :: c_int ;
1224-
12251233 pub fn waitid ( idtype : idtype_t , id : :: id_t , infop : * mut :: siginfo_t ,
12261234 options : :: c_int ) -> :: c_int ;
12271235
0 commit comments