Fix style for linux
This commit is contained in:
parent
d3d77922eb
commit
c89d56bc15
@ -1,11 +1,36 @@
|
||||
//! Linux-specific definitions for linux-like values
|
||||
|
||||
pub const BUFSIZ: c_uint = 8192;
|
||||
pub const FILENAME_MAX: c_uint = 4096;
|
||||
pub const FOPEN_MAX: c_uint = 16;
|
||||
pub const L_tmpnam: c_uint = 20;
|
||||
pub const TMP_MAX: c_uint = 238328;
|
||||
pub const _PC_NAME_MAX: c_int = 3;
|
||||
s! {
|
||||
pub struct glob_t {
|
||||
pub gl_pathc: ::size_t,
|
||||
pub gl_pathv: *mut *mut ::c_char,
|
||||
pub gl_offs: ::size_t,
|
||||
pub gl_flags: ::c_int,
|
||||
|
||||
__unused1: *mut ::c_void,
|
||||
__unused2: *mut ::c_void,
|
||||
__unused3: *mut ::c_void,
|
||||
__unused4: *mut ::c_void,
|
||||
__unused5: *mut ::c_void,
|
||||
}
|
||||
|
||||
pub struct ifaddrs {
|
||||
pub ifa_next: *mut ::ifaddrs,
|
||||
pub ifa_name: *mut ::c_char,
|
||||
pub ifa_flags: ::c_uint,
|
||||
pub ifa_addr: *mut ::sockaddr,
|
||||
pub ifa_netmask: *mut ::sockaddr,
|
||||
pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
|
||||
pub ifa_data: *mut ::c_void
|
||||
}
|
||||
}
|
||||
|
||||
pub const BUFSIZ: ::c_uint = 8192;
|
||||
pub const FILENAME_MAX: ::c_uint = 4096;
|
||||
pub const FOPEN_MAX: ::c_uint = 16;
|
||||
pub const L_tmpnam: ::c_uint = 20;
|
||||
pub const TMP_MAX: ::c_uint = 238328;
|
||||
pub const _PC_NAME_MAX: ::c_int = 3;
|
||||
|
||||
pub const _SC_ARG_MAX: ::c_int = 0;
|
||||
pub const _SC_CHILD_MAX: ::c_int = 1;
|
||||
@ -35,7 +60,7 @@ pub const _SC_AIO_MAX: ::c_int = 24;
|
||||
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
|
||||
pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
|
||||
pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
|
||||
pub const _SC_MQ_PRIO_MAX: c_int = 28;
|
||||
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_RTSIG_MAX: ::c_int = 31;
|
||||
@ -58,69 +83,44 @@ pub const _SC_2_FORT_DEV: ::c_int = 49;
|
||||
pub const _SC_2_FORT_RUN: ::c_int = 50;
|
||||
pub const _SC_2_SW_DEV: ::c_int = 51;
|
||||
pub const _SC_2_LOCALEDEF: ::c_int = 52;
|
||||
pub const _SC_IOV_MAX: c_int = 60;
|
||||
pub const _SC_THREADS: c_int = 67;
|
||||
pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
|
||||
pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
|
||||
pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
|
||||
pub const _SC_LOGIN_NAME_MAX: c_int = 71;
|
||||
pub const _SC_TTY_NAME_MAX: c_int = 72;
|
||||
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
|
||||
pub const _SC_THREAD_KEYS_MAX: c_int = 74;
|
||||
pub const _SC_THREAD_STACK_MIN: c_int = 75;
|
||||
pub const _SC_THREAD_THREADS_MAX: c_int = 76;
|
||||
pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
|
||||
pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
|
||||
pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
|
||||
pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
|
||||
pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
|
||||
pub const _SC_IOV_MAX: ::c_int = 60;
|
||||
pub const _SC_THREADS: ::c_int = 67;
|
||||
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
|
||||
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
|
||||
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
|
||||
pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
|
||||
pub const _SC_TTY_NAME_MAX: ::c_int = 72;
|
||||
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
|
||||
pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
|
||||
pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
|
||||
pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
|
||||
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
|
||||
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
|
||||
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
|
||||
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
|
||||
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
|
||||
pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
|
||||
pub const _SC_ATEXIT_MAX: c_int = 87;
|
||||
pub const _SC_XOPEN_VERSION: c_int = 89;
|
||||
pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
|
||||
pub const _SC_XOPEN_UNIX: c_int = 91;
|
||||
pub const _SC_XOPEN_CRYPT: c_int = 92;
|
||||
pub const _SC_XOPEN_ENH_I18N: c_int = 93;
|
||||
pub const _SC_XOPEN_SHM: c_int = 94;
|
||||
pub const _SC_ATEXIT_MAX: ::c_int = 87;
|
||||
pub const _SC_XOPEN_VERSION: ::c_int = 89;
|
||||
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
|
||||
pub const _SC_XOPEN_UNIX: ::c_int = 91;
|
||||
pub const _SC_XOPEN_CRYPT: ::c_int = 92;
|
||||
pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
|
||||
pub const _SC_XOPEN_SHM: ::c_int = 94;
|
||||
pub const _SC_2_CHAR_TERM: ::c_int = 95;
|
||||
pub const _SC_2_C_VERSION: ::c_int = 96;
|
||||
pub const _SC_2_UPE: ::c_int = 97;
|
||||
pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
|
||||
pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
|
||||
pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
|
||||
pub const _SC_XOPEN_LEGACY: c_int = 129;
|
||||
pub const _SC_XOPEN_REALTIME: c_int = 130;
|
||||
pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
|
||||
|
||||
s! {
|
||||
pub struct glob_t {
|
||||
pub gl_pathc: size_t,
|
||||
pub gl_pathv: *mut *mut c_char,
|
||||
pub gl_offs: size_t,
|
||||
pub gl_flags: c_int,
|
||||
|
||||
__unused1: *mut ::c_void,
|
||||
__unused2: *mut ::c_void,
|
||||
__unused3: *mut ::c_void,
|
||||
__unused4: *mut ::c_void,
|
||||
__unused5: *mut ::c_void,
|
||||
}
|
||||
|
||||
pub struct ifaddrs {
|
||||
pub ifa_next: *mut ifaddrs,
|
||||
pub ifa_name: *mut c_char,
|
||||
pub ifa_flags: c_uint,
|
||||
pub ifa_addr: *mut sockaddr,
|
||||
pub ifa_netmask: *mut sockaddr,
|
||||
pub ifa_ifu: *mut sockaddr, // FIXME This should be a union
|
||||
pub ifa_data: *mut ::c_void
|
||||
}
|
||||
}
|
||||
pub const _SC_XOPEN_LEGACY: ::c_int = 129;
|
||||
pub const _SC_XOPEN_REALTIME: ::c_int = 130;
|
||||
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
|
||||
|
||||
pub const RLIMIT_NLIMITS: ::c_int = 16;
|
||||
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
|
||||
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
|
||||
pub const RUSAGE_THREAD: c_int = 1;
|
||||
pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
|
||||
pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
|
||||
pub const RUSAGE_THREAD: ::c_int = 1;
|
||||
|
||||
pub const GLOB_ERR: ::c_int = 1 << 0;
|
||||
pub const GLOB_MARK: ::c_int = 1 << 1;
|
||||
|
@ -81,37 +81,37 @@ cfg_if! {
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd"))] {
|
||||
extern {
|
||||
pub fn sysctl(name: *mut c_int,
|
||||
namelen: c_uint,
|
||||
oldp: *mut c_void,
|
||||
oldlenp: *mut size_t,
|
||||
newp: *mut c_void,
|
||||
newlen: size_t)
|
||||
-> c_int;
|
||||
pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char)
|
||||
-> c_int;
|
||||
pub fn sysctlbyname(name: *const c_char,
|
||||
oldp: *mut c_void,
|
||||
oldlenp: *mut size_t,
|
||||
newp: *mut c_void,
|
||||
newlen: size_t)
|
||||
-> c_int;
|
||||
pub fn sysctlnametomib(name: *const c_char,
|
||||
mibp: *mut c_int,
|
||||
sizep: *mut size_t)
|
||||
-> c_int;
|
||||
pub fn sysctl(name: *mut ::c_int,
|
||||
namelen: ::c_uint,
|
||||
oldp: *mut ::c_void,
|
||||
oldlenp: *mut ::size_t,
|
||||
newp: *mut ::c_void,
|
||||
newlen: ::size_t)
|
||||
-> ::c_int;
|
||||
pub fn mincore(addr: *const ::c_void, len: ::size_t,
|
||||
vec: *mut ::c_char) -> ::c_int;
|
||||
pub fn sysctlbyname(name: *const ::c_char,
|
||||
oldp: *mut ::c_void,
|
||||
oldlenp: *mut ::size_t,
|
||||
newp: *mut ::c_void,
|
||||
newlen: ::size_t)
|
||||
-> ::c_int;
|
||||
pub fn sysctlnametomib(name: *const ::c_char,
|
||||
mibp: *mut ::c_int,
|
||||
sizep: *mut ::size_t)
|
||||
-> ::c_int;
|
||||
}
|
||||
} else {
|
||||
extern {
|
||||
pub fn sysctl(name: *mut c_int,
|
||||
namelen: c_int,
|
||||
oldp: *mut c_void,
|
||||
oldlenp: *mut size_t,
|
||||
newp: *mut c_void,
|
||||
newlen: size_t)
|
||||
-> c_int;
|
||||
pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
|
||||
-> c_int;
|
||||
pub fn sysctl(name: *mut ::c_int,
|
||||
namelen: ::c_int,
|
||||
oldp: *mut ::c_void,
|
||||
oldlenp: *mut ::size_t,
|
||||
newp: *mut ::c_void,
|
||||
newlen: ::size_t)
|
||||
-> ::c_int;
|
||||
pub fn mincore(addr: *mut ::c_void, len: ::size_t,
|
||||
vec: *mut ::c_uchar) -> ::c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user