From b7a2de0539ccd35cf78f9ff3a06f1b3275bcf27a Mon Sep 17 00:00:00 2001 From: Steven Engler Date: Wed, 13 Jul 2022 14:37:49 -0400 Subject: [PATCH] Added non-standard Linux `SysconfVar` variants --- CHANGELOG.md | 2 ++ src/unistd.rs | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0bdeb3489..1109818be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - ReleaseDate ### Added +- Added four non-standard Linux `SysconfVar` variants + (#[1761](https://github.com/nix-rust/nix/pull/1761)) - Added const constructors for `TimeSpec` and `TimeVal` (#[1760](https://github.com/nix-rust/nix/pull/1760)) - Added `aio_writev` and `aio_readv`. diff --git a/src/unistd.rs b/src/unistd.rs index 056b552936..e738349a21 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