summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-07-13 21:01:47 +0000
committerGitHub <noreply@github.com>2022-07-13 21:01:47 +0000
commitfb65331a559ce3a51640ef6431562eea6cd39725 (patch)
treec1c1bcd567d0890798d5a0d3aca1f6a93b3c017a /src
parent5f859d10dfd21b99405054d80392649adc392fd0 (diff)
parentb7a2de0539ccd35cf78f9ff3a06f1b3275bcf27a (diff)
downloadnix-fb65331a559ce3a51640ef6431562eea6cd39725.zip
Merge #1761
1761: Add non-standard Linux `SysconfVar` variants r=asomers a=stevenengler Closes #1240. You can find these options near the end of https://man7.org/linux/man-pages/man3/sysconf.3.html. I can see that the libc crate defines these for Linux and Android, but I'm not sure if they're defined for any others as well. Co-authored-by: Steven Engler <opara@cs.georgetown.edu>
Diffstat (limited to 'src')
-rw-r--r--src/unistd.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index 056b5529..e738349a 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -2668,6 +2668,19 @@ pub enum SysconfVar {
/// Integer value indicating version of the X/Open Portability Guide to
/// which the implementation conforms.
_XOPEN_VERSION = libc::_SC_XOPEN_VERSION,
+ /// The number of pages of physical memory. Note that it is possible for
+ /// the product of this value to overflow.
+ #[cfg(any(target_os="android", target_os="linux"))]
+ _PHYS_PAGES = libc::_SC_PHYS_PAGES,
+ /// The number of currently available pages of physical memory.
+ #[cfg(any(target_os="android", target_os="linux"))]
+ _AVPHYS_PAGES = libc::_SC_AVPHYS_PAGES,
+ /// The number of processors configured.
+ #[cfg(any(target_os="android", target_os="linux"))]
+ _NPROCESSORS_CONF = libc::_SC_NPROCESSORS_CONF,
+ /// The number of processors currently online (available).
+ #[cfg(any(target_os="android", target_os="linux"))]
+ _NPROCESSORS_ONLN = libc::_SC_NPROCESSORS_ONLN,
}
/// Get configurable system variables (see