Skip to content

Commit

Permalink
Move the SC constants for macos to an accessible module (fixes #24374
Browse files Browse the repository at this point in the history
…for mac).

These constants were added in 6f54ce9 and
e8fbd1c to a consts module that is behind a
gate.

I have not confirmed that these constants do indeed work on either OSX or iOS.

It appears that some of the constants may actually belong in a POSIX module,
but I didn't make these changes here because I don't have access to the POSIX
standard.
  • Loading branch information
Ms2ger committed May 6, 2015
1 parent 6517a0e commit ff89600
Showing 1 changed file with 44 additions and 133 deletions.
177 changes: 44 additions & 133 deletions src/liblibc/lib.rs
Expand Up @@ -3779,139 +3779,6 @@ pub mod consts {
pub static _SC_PAGESIZE : c_int = 2;
}

#[cfg(target_os = "macos")]
pub mod sysconf {
use types::os::arch::c95::c_int;
pub static _SC_ARG_MAX : c_int = 1;
pub static _SC_CHILD_MAX : c_int = 2;
pub static _SC_CLK_TCK : c_int = 3;
pub static _SC_NGROUPS_MAX : c_int = 4;
pub static _SC_OPEN_MAX : c_int = 5;
pub static _SC_JOB_CONTROL : c_int = 6;
pub static _SC_SAVED_IDS : c_int = 7;
pub static _SC_VERSION : c_int = 8;
pub static _SC_BC_BASE_MAX : c_int = 9;
pub static _SC_BC_DIM_MAX : c_int = 10;
pub static _SC_BC_SCALE_MAX : c_int = 11;
pub static _SC_BC_STRING_MAX : c_int = 12;
pub static _SC_COLL_WEIGHTS_MAX : c_int = 13;
pub static _SC_EXPR_NEST_MAX : c_int = 14;
pub static _SC_LINE_MAX : c_int = 15;
pub static _SC_RE_DUP_MAX : c_int = 16;
pub static _SC_2_VERSION : c_int = 17;
pub static _SC_2_C_BIND : c_int = 18;
pub static _SC_2_C_DEV : c_int = 19;
pub static _SC_2_CHAR_TERM : c_int = 20;
pub static _SC_2_FORT_DEV : c_int = 21;
pub static _SC_2_FORT_RUN : c_int = 22;
pub static _SC_2_LOCALEDEF : c_int = 23;
pub static _SC_2_SW_DEV : c_int = 24;
pub static _SC_2_UPE : c_int = 25;
pub static _SC_STREAM_MAX : c_int = 26;
pub static _SC_TZNAME_MAX : c_int = 27;
pub static _SC_ASYNCHRONOUS_IO : c_int = 28;
pub static _SC_PAGESIZE : c_int = 29;
pub static _SC_MEMLOCK : c_int = 30;
pub static _SC_MEMLOCK_RANGE : c_int = 31;
pub static _SC_MEMORY_PROTECTION : c_int = 32;
pub static _SC_MESSAGE_PASSING : c_int = 33;
pub static _SC_PRIORITIZED_IO : c_int = 34;
pub static _SC_PRIORITY_SCHEDULING : c_int = 35;
pub static _SC_REALTIME_SIGNALS : c_int = 36;
pub static _SC_SEMAPHORES : c_int = 37;
pub static _SC_FSYNC : c_int = 38;
pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
pub static _SC_SYNCHRONIZED_IO : c_int = 40;
pub static _SC_TIMERS : c_int = 41;
pub static _SC_AIO_LISTIO_MAX : c_int = 42;
pub static _SC_AIO_MAX : c_int = 43;
pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
pub static _SC_DELAYTIMER_MAX : c_int = 45;
pub static _SC_MQ_OPEN_MAX : c_int = 46;
pub static _SC_MAPPED_FILES : c_int = 47;
pub static _SC_RTSIG_MAX : c_int = 48;
pub static _SC_SEM_NSEMS_MAX : c_int = 49;
pub static _SC_SEM_VALUE_MAX : c_int =50;
pub static _SC_SIGQUEUE_MAX : c_int = 51;
pub static _SC_TIMER_MAX : c_int = 52;
pub static _SC_NPROCESSORS_CONF : c_int = 57;
pub static _SC_NPROCESSORS_ONLN : c_int = 58;
pub static _SC_2_PBS : c_int = 59;
pub static _SC_2_PBS_ACCOUNTING : c_int = 60;
pub static _SC_2_PBS_CHECKPOINT : c_int = 61;
pub static _SC_2_PBS_LOCATE : c_int = 62;
pub static _SC_2_PBS_MESSAGE : c_int = 63;
pub static _SC_2_PBS_TRACK : c_int = 64;
pub static _SC_ADVISORY_INFO : c_int = 65;
pub static _SC_BARRIERS : c_int = 66;
pub static _SC_CLOCK_SELECTION : c_int = 67;
pub static _SC_CPUTIME : c_int = 68;
pub static _SC_FILE_LOCKING : c_int = 69;
pub static _SC_GETGR_R_SIZE_MAX : c_int = 70;
pub static _SC_GETPW_R_SIZE_MAX : c_int = 71;
pub static _SC_HOST_NAME_MAX : c_int = 72;
pub static _SC_LOGIN_NAME_MAX : c_int = 73;
pub static _SC_MONOTONIC_CLOCK : c_int = 74;
pub static _SC_MQ_PRIO_MAX : c_int = 75;
pub static _SC_READER_WRITER_LOCKS : c_int = 76;
pub static _SC_REGEXP : c_int = 77;
pub static _SC_SHELL : c_int = 78;
pub static _SC_SPAWN : c_int = 79;
pub static _SC_SPIN_LOCKS : c_int = 80;
pub static _SC_SPORADIC_SERVER : c_int = 81;
pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82;
pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
pub static _SC_THREAD_CPUTIME : c_int = 84;
pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
pub static _SC_THREAD_KEYS_MAX : c_int = 86;
pub static _SC_THREAD_PRIO_INHERIT : c_int = 87;
pub static _SC_THREAD_PRIO_PROTECT : c_int = 88;
pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
pub static _SC_THREAD_PROCESS_SHARED : c_int = 90;
pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
pub static _SC_THREAD_SPORADIC_SERVER : c_int = 92;
pub static _SC_THREAD_STACK_MIN : c_int = 93;
pub static _SC_THREAD_THREADS_MAX : c_int = 94;
pub static _SC_TIMEOUTS : c_int = 95;
pub static _SC_THREADS : c_int = 96;
pub static _SC_TRACE : c_int = 97;
pub static _SC_TRACE_EVENT_FILTER: c_int = 98;
pub static _SC_TRACE_INHERIT: c_int = 99;
pub static _SC_TRACE_LOG: c_int = 100;
pub static _SC_TTY_NAME_MAX: c_int = 101;
pub static _SC_TYPED_MEMORY_OBJECTS: c_int = 102;
pub static _SC_V6_ILP32_OFF32: c_int = 103;
pub static _SC_V6_ILP32_OFFBIG: c_int = 104;
pub static _SC_V6_LP64_OFF64: c_int = 105;
pub static _SC_V6_LPBIG_OFFBIG: c_int = 106;
pub static _SC_IPV6: c_int = 118;
pub static _SC_RAW_SOCKETS: c_int = 119;
pub static _SC_SYMLOOP_MAX: c_int = 120;
pub static _SC_ATEXIT_MAX: c_int = 107;
pub static _SC_IOV_MAX: c_int = 56;
pub static _SC_PAGE_SIZE: cint = _SC_PAGESIZE;
pub static _SC_XOPEN_CRYPT: c_int = 108;
pub static _SC_XOPEN_ENH_I18N: c_int = 109;
pub static _SC_XOPEN_LEGACY: c_int = 110;
pub static _SC_XOPEN_REALTIME: c_int = 111;
pub static _SC_XOPEN_REALTIME_THREADS: c_int = 112;
pub static _SC_XOPEN_SHM: c_int = 113;
pub static _SC_XOPEN_STREAMS: c_int = 114;
pub static _SC_XOPEN_UNIX: c_int = 115;
pub static _SC_XOPEN_VERSION: c_int = 116;
pub static _SC_XOPEN_XCU_VERSION: c_int = 121;
pub static _SC_XBS5_ILP32_OFF32: c_int = 122;
pub static _SC_XBS5_ILP32_OFFBIG: c_int = 123;
pub static _SC_XBS5_LP64_OFF64: c_int = 124;
pub static _SC_XBS5_LPBIG_OFFBIG: c_int = 125;
pub static _SC_SS_REPL_MAX: c_int = 126;
pub static _SC_TRACE_EVENT_NAME_MAX: c_int = 127;
pub static _SC_TRACE_NAME_MAX: c_int = 128;
pub static _SC_TRACE_SYS_MAX: c_int = 129;
pub static _SC_TRACE_USER_EVENT_MAX: c_int = 130;
pub static _SC_PASS_MAX: c_int = 131;
}

#[cfg(target_os = "android")]
pub mod sysconf {
use types::os::arch::c95::c_int;
Expand Down Expand Up @@ -5272,10 +5139,54 @@ pub mod consts {
pub const _SC_SEM_VALUE_MAX : c_int = 50;
pub const _SC_SIGQUEUE_MAX : c_int = 51;
pub const _SC_TIMER_MAX : c_int = 52;
pub const _SC_NPROCESSORS_CONF : c_int = 57;
pub const _SC_NPROCESSORS_ONLN : c_int = 58;
pub const _SC_2_PBS : c_int = 59;
pub const _SC_2_PBS_ACCOUNTING : c_int = 60;
pub const _SC_2_PBS_CHECKPOINT : c_int = 61;
pub const _SC_2_PBS_LOCATE : c_int = 62;
pub const _SC_2_PBS_MESSAGE : c_int = 63;
pub const _SC_2_PBS_TRACK : c_int = 64;
pub const _SC_ADVISORY_INFO : c_int = 65;
pub const _SC_BARRIERS : c_int = 66;
pub const _SC_CLOCK_SELECTION : c_int = 67;
pub const _SC_CPUTIME : c_int = 68;
pub const _SC_FILE_LOCKING : c_int = 69;
pub const _SC_HOST_NAME_MAX : c_int = 72;
pub const _SC_MONOTONIC_CLOCK : c_int = 74;
pub const _SC_READER_WRITER_LOCKS : c_int = 76;
pub const _SC_REGEXP : c_int = 77;
pub const _SC_SHELL : c_int = 78;
pub const _SC_SPAWN : c_int = 79;
pub const _SC_SPIN_LOCKS : c_int = 80;
pub const _SC_SPORADIC_SERVER : c_int = 81;
pub const _SC_THREAD_CPUTIME : c_int = 84;
pub const _SC_THREAD_SPORADIC_SERVER : c_int = 92;
pub const _SC_TIMEOUTS : c_int = 95;
pub const _SC_TRACE : c_int = 97;
pub const _SC_TRACE_EVENT_FILTER : c_int = 98;
pub const _SC_TRACE_INHERIT : c_int = 99;
pub const _SC_TRACE_LOG : c_int = 100;
pub const _SC_TYPED_MEMORY_OBJECTS : c_int = 102;
pub const _SC_V6_ILP32_OFF32 : c_int = 103;
pub const _SC_V6_ILP32_OFFBIG : c_int = 104;
pub const _SC_V6_LP64_OFF64 : c_int = 105;
pub const _SC_V6_LPBIG_OFFBIG : c_int = 106;
pub const _SC_IPV6 : c_int = 118;
pub const _SC_RAW_SOCKETS : c_int = 119;
pub const _SC_SYMLOOP_MAX : c_int = 120;
pub const _SC_PAGE_SIZE : c_int = _SC_PAGESIZE;
pub const _SC_XOPEN_STREAMS : c_int = 114;
pub const _SC_XBS5_ILP32_OFF32 : c_int = 122;
pub const _SC_XBS5_ILP32_OFFBIG : c_int = 123;
pub const _SC_XBS5_LP64_OFF64 : c_int = 124;
pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 125;
pub const _SC_SS_REPL_MAX : c_int = 126;
pub const _SC_TRACE_EVENT_NAME_MAX : c_int = 127;
pub const _SC_TRACE_NAME_MAX : c_int = 128;
pub const _SC_TRACE_SYS_MAX : c_int = 129;
pub const _SC_TRACE_USER_EVENT_MAX : c_int = 130;
pub const _SC_PASS_MAX : c_int = 131;
}
}
}
Expand Down

0 comments on commit ff89600

Please sign in to comment.