From 11f29f592a77a18eaa641fff474462ce01bee96c Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Sun, 31 Jan 2016 21:28:16 -0500 Subject: [PATCH] Define _SC_PAGE_SIZE constants According to POSIX, sysconf can take _SC_PAGESIZE or _SC_PAGE_SIZE, which may be the same value. This constant was define in "apple" as equal to _SC_PAGESIZE, but not any of the other platforms. Add definitions for _SC_PAGE_SIZE for all platforms which had _SC_PAGESIZE defined. On all platforms but Android (Bionic), they are the same value; on Android _SC_PAGE_SIZE has a different value. --- src/unix/bsd/freebsdlike/mod.rs | 1 + src/unix/bsd/openbsdlike/mod.rs | 1 + src/unix/notbsd/android/mod.rs | 1 + src/unix/notbsd/linux/mod.rs | 1 + src/unix/solaris/mod.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 4b3a504d..9f2b172e 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -548,6 +548,7 @@ pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; pub const _SC_DELAYTIMER_MAX: ::c_int = 45; pub const _SC_MQ_OPEN_MAX: ::c_int = 46; pub const _SC_PAGESIZE: ::c_int = 47; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; pub const _SC_RTSIG_MAX: ::c_int = 48; pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; pub const _SC_SEM_VALUE_MAX: ::c_int = 50; diff --git a/src/unix/bsd/openbsdlike/mod.rs b/src/unix/bsd/openbsdlike/mod.rs index d4319b2d..1ef5938c 100644 --- a/src/unix/bsd/openbsdlike/mod.rs +++ b/src/unix/bsd/openbsdlike/mod.rs @@ -362,6 +362,7 @@ pub const _SC_2_UPE : ::c_int = 25; pub const _SC_STREAM_MAX : ::c_int = 26; pub const _SC_TZNAME_MAX : ::c_int = 27; pub const _SC_PAGESIZE : ::c_int = 28; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; pub const _SC_FSYNC : ::c_int = 29; pub const KERN_PROC_ARGV: ::c_int = 1; diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index c6169586..f6d47a3e 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -196,6 +196,7 @@ pub const _SC_XOPEN_LEGACY: ::c_int = 36; pub const _SC_ATEXIT_MAX: ::c_int = 37; pub const _SC_IOV_MAX: ::c_int = 38; pub const _SC_PAGESIZE: ::c_int = 39; +pub const _SC_PAGE_SIZE: ::c_int = 40; pub const _SC_XOPEN_UNIX: ::c_int = 41; pub const _SC_MQ_PRIO_MAX: ::c_int = 51; pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index e54d21ba..9a9ecc47 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -220,6 +220,7 @@ pub const _SC_MQ_OPEN_MAX: ::c_int = 27; pub const _SC_MQ_PRIO_MAX: ::c_int = 28; pub const _SC_VERSION: ::c_int = 29; pub const _SC_PAGESIZE: ::c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; pub const _SC_RTSIG_MAX: ::c_int = 31; pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; pub const _SC_SEM_VALUE_MAX: ::c_int = 33; diff --git a/src/unix/solaris/mod.rs b/src/unix/solaris/mod.rs index 2976c357..c6596f1f 100644 --- a/src/unix/solaris/mod.rs +++ b/src/unix/solaris/mod.rs @@ -626,6 +626,7 @@ pub const _SC_JOB_CONTROL: ::c_int = 6; pub const _SC_SAVED_IDS: ::c_int = 7; pub const _SC_VERSION: ::c_int = 8; pub const _SC_PAGESIZE: ::c_int = 11; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; pub const _SC_NPROCESSORS_ONLN: ::c_int = 15; pub const _SC_STREAM_MAX: ::c_int = 16; pub const _SC_TZNAME_MAX: ::c_int = 17;