Skip to content

Commit 11f29f5

Browse files
committed
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.
1 parent cb12fdf commit 11f29f5

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
548548
pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
549549
pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
550550
pub const _SC_PAGESIZE: ::c_int = 47;
551+
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
551552
pub const _SC_RTSIG_MAX: ::c_int = 48;
552553
pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
553554
pub const _SC_SEM_VALUE_MAX: ::c_int = 50;

src/unix/bsd/openbsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ pub const _SC_2_UPE : ::c_int = 25;
362362
pub const _SC_STREAM_MAX : ::c_int = 26;
363363
pub const _SC_TZNAME_MAX : ::c_int = 27;
364364
pub const _SC_PAGESIZE : ::c_int = 28;
365+
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
365366
pub const _SC_FSYNC : ::c_int = 29;
366367

367368
pub const KERN_PROC_ARGV: ::c_int = 1;

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ pub const _SC_XOPEN_LEGACY: ::c_int = 36;
196196
pub const _SC_ATEXIT_MAX: ::c_int = 37;
197197
pub const _SC_IOV_MAX: ::c_int = 38;
198198
pub const _SC_PAGESIZE: ::c_int = 39;
199+
pub const _SC_PAGE_SIZE: ::c_int = 40;
199200
pub const _SC_XOPEN_UNIX: ::c_int = 41;
200201
pub const _SC_MQ_PRIO_MAX: ::c_int = 51;
201202
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71;

src/unix/notbsd/linux/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
220220
pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
221221
pub const _SC_VERSION: ::c_int = 29;
222222
pub const _SC_PAGESIZE: ::c_int = 30;
223+
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
223224
pub const _SC_RTSIG_MAX: ::c_int = 31;
224225
pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
225226
pub const _SC_SEM_VALUE_MAX: ::c_int = 33;

src/unix/solaris/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ pub const _SC_JOB_CONTROL: ::c_int = 6;
626626
pub const _SC_SAVED_IDS: ::c_int = 7;
627627
pub const _SC_VERSION: ::c_int = 8;
628628
pub const _SC_PAGESIZE: ::c_int = 11;
629+
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
629630
pub const _SC_NPROCESSORS_ONLN: ::c_int = 15;
630631
pub const _SC_STREAM_MAX: ::c_int = 16;
631632
pub const _SC_TZNAME_MAX: ::c_int = 17;

0 commit comments

Comments
 (0)