Skip to content

Commit 8533f16

Browse files
committed
Fix build of sysconf variables on NetBSD
1 parent 9d64652 commit 8533f16

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/unistd.rs

+39
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ pub fn pathconf<P: ?Sized + NixPath>(path: &P, var: PathconfVar) -> Result<Optio
947947
pub enum SysconfVar {
948948
AIO_LISTIO_MAX = libc::_SC_AIO_LISTIO_MAX,
949949
AIO_MAX = libc::_SC_AIO_MAX,
950+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
951+
target_os="linux", target_os = "macos", target_os="openbsd"))]
950952
AIO_PRIO_DELTA_MAX = libc::_SC_AIO_PRIO_DELTA_MAX,
951953
ARG_MAX = libc::_SC_ARG_MAX,
952954
ATEXIT_MAX = libc::_SC_ATEXIT_MAX,
@@ -957,6 +959,8 @@ BC_STRING_MAX = libc::_SC_BC_STRING_MAX,
957959
CHILD_MAX = libc::_SC_CHILD_MAX,
958960
// _SC_CLK_TCK is obsolete
959961
COLL_WEIGHTS_MAX = libc::_SC_COLL_WEIGHTS_MAX,
962+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
963+
target_os="linux", target_os = "macos", target_os="openbsd"))]
960964
DELAYTIMER_MAX = libc::_SC_DELAYTIMER_MAX,
961965
EXPR_NEST_MAX = libc::_SC_EXPR_NEST_MAX,
962966
HOST_NAME_MAX = libc::_SC_HOST_NAME_MAX,
@@ -989,12 +993,16 @@ _POSIX_MEMORY_PROTECTION = libc::_SC_MEMORY_PROTECTION,
989993
_POSIX_MESSAGE_PASSING = libc::_SC_MESSAGE_PASSING,
990994
#[cfg(any(target_os = "ios", target_os = "macos"))]
991995
_POSIX_MONOTONIC_CLOCK = libc::_SC_MONOTONIC_CLOCK,
996+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
997+
target_os="linux", target_os = "macos", target_os="openbsd"))]
992998
_POSIX_PRIORITIZED_IO = libc::_SC_PRIORITIZED_IO,
993999
_POSIX_PRIORITY_SCHEDULING = libc::_SC_PRIORITY_SCHEDULING,
9941000
#[cfg(any(target_os = "ios", target_os = "macos"))]
9951001
_POSIX_RAW_SOCKETS = libc::_SC_RAW_SOCKETS,
9961002
#[cfg(any(target_os = "ios", target_os = "macos"))]
9971003
_POSIX_READER_WRITER_LOCKS = libc::_SC_READER_WRITER_LOCKS,
1004+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1005+
target_os="linux", target_os = "macos", target_os="openbsd"))]
9981006
_POSIX_REALTIME_SIGNALS = libc::_SC_REALTIME_SIGNALS,
9991007
#[cfg(any(target_os = "ios", target_os = "macos"))]
10001008
_POSIX_REGEXP = libc::_SC_REGEXP,
@@ -1087,25 +1095,56 @@ PTHREAD_KEYS_MAX = libc::_SC_THREAD_KEYS_MAX,
10871095
PTHREAD_STACK_MIN = libc::_SC_THREAD_STACK_MIN,
10881096
PTHREAD_THREADS_MAX = libc::_SC_THREAD_THREADS_MAX,
10891097
RE_DUP_MAX = libc::_SC_RE_DUP_MAX,
1098+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1099+
target_os="linux", target_os = "macos", target_os="openbsd"))]
10901100
RTSIG_MAX = libc::_SC_RTSIG_MAX,
1101+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1102+
target_os="linux", target_os = "macos", target_os="openbsd"))]
10911103
SEM_NSEMS_MAX = libc::_SC_SEM_NSEMS_MAX,
1104+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1105+
target_os="linux", target_os = "macos", target_os="openbsd"))]
10921106
SEM_VALUE_MAX = libc::_SC_SEM_VALUE_MAX,
1107+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1108+
target_os="linux", target_os = "macos", target_os="openbsd"))]
10931109
SIGQUEUE_MAX = libc::_SC_SIGQUEUE_MAX,
10941110
STREAM_MAX = libc::_SC_STREAM_MAX,
10951111
#[cfg(any(target_os = "ios", target_os = "macos"))]
10961112
SYMLOOP_MAX = libc::_SC_SYMLOOP_MAX,
1113+
#[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios",
1114+
target_os="linux", target_os = "macos", target_os="openbsd"))]
10971115
TIMER_MAX = libc::_SC_TIMER_MAX,
10981116
TTY_NAME_MAX = libc::_SC_TTY_NAME_MAX,
10991117
TZNAME_MAX = libc::_SC_TZNAME_MAX,
1118+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1119+
target_os = "ios", target_os="linux", target_os = "macos",
1120+
target_os="openbsd"))]
11001121
_XOPEN_CRYPT = libc::_SC_XOPEN_CRYPT,
1122+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1123+
target_os = "ios", target_os="linux", target_os = "macos",
1124+
target_os="openbsd"))]
11011125
_XOPEN_ENH_I18N = libc::_SC_XOPEN_ENH_I18N,
1126+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1127+
target_os = "ios", target_os="linux", target_os = "macos",
1128+
target_os="openbsd"))]
11021129
_XOPEN_LEGACY = libc::_SC_XOPEN_LEGACY,
1130+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1131+
target_os = "ios", target_os="linux", target_os = "macos",
1132+
target_os="openbsd"))]
11031133
_XOPEN_REALTIME = libc::_SC_XOPEN_REALTIME,
1134+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1135+
target_os = "ios", target_os="linux", target_os = "macos",
1136+
target_os="openbsd"))]
11041137
_XOPEN_REALTIME_THREADS = libc::_SC_XOPEN_REALTIME_THREADS,
11051138
_XOPEN_SHM = libc::_SC_XOPEN_SHM,
11061139
#[cfg(any(target_os = "ios", target_os = "macos"))]
11071140
_XOPEN_STREAMS = libc::_SC_XOPEN_STREAMS,
1141+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1142+
target_os = "ios", target_os="linux", target_os = "macos",
1143+
target_os="openbsd"))]
11081144
_XOPEN_UNIX = libc::_SC_XOPEN_UNIX,
1145+
#[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd",
1146+
target_os = "ios", target_os="linux", target_os = "macos",
1147+
target_os="openbsd"))]
11091148
_XOPEN_VERSION = libc::_SC_XOPEN_VERSION,
11101149
}
11111150

0 commit comments

Comments
 (0)