commit
fa3f6e729e
14
README.md
14
README.md
|
@ -8,3 +8,17 @@ various systems, including libc.
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/v0414slj8y8nga0p?svg=true)](https://ci.appveyor.com/project/alexcrichton/libc)
|
[![Build status](https://ci.appveyor.com/api/projects/status/v0414slj8y8nga0p?svg=true)](https://ci.appveyor.com/project/alexcrichton/libc)
|
||||||
|
|
||||||
[Documentation](http://alexcrichton.com/libc)
|
[Documentation](http://alexcrichton.com/libc)
|
||||||
|
|
||||||
|
## Platform Support
|
||||||
|
|
||||||
|
Tested:
|
||||||
|
* `{i686,x86_64}-pc-windows-{msvc,gnu}`
|
||||||
|
* `{i686,x86_64,mips,aarch64}-unknown-linux-gnu`
|
||||||
|
* `x86_64-unknown-linux-musl`
|
||||||
|
* `arm-unknown-linux-gnueabihf`
|
||||||
|
* `arm-linux-androideabi`
|
||||||
|
* `{i686,x86_64}-apple-darwin`
|
||||||
|
|
||||||
|
Untested:
|
||||||
|
* `{i686,x86_64}-unknown-freebsd`
|
||||||
|
* `x86_64-unknown-{bitrig,dragonfly,openbsd,netbsd}`
|
||||||
|
|
|
@ -26,3 +26,7 @@ build: false
|
||||||
test_script:
|
test_script:
|
||||||
- cargo test
|
- cargo test
|
||||||
- cargo run --manifest-path libc-test/Cargo.toml
|
- cargo run --manifest-path libc-test/Cargo.toml
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- autotest
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
# A vagrant configuration file for running tests on BSD-like machines
|
||||||
|
#
|
||||||
|
# Note that this was originally intended to later be used to run tests on
|
||||||
|
# Travis, but it didn't work out. Regardless this has stuck around! You can run
|
||||||
|
# tests in FreeBSD via:
|
||||||
|
#
|
||||||
|
# git clone https://github.com/alexcrichton/libc --branch autotest
|
||||||
|
# cd libc/ci
|
||||||
|
# vagrant up freebsd
|
||||||
|
# vagrant ssh freebsd
|
||||||
|
# ...
|
||||||
|
# cd /vagrant/libc-test
|
||||||
|
# cargo run
|
||||||
|
#
|
||||||
|
# And "that's it"! You look up instructions on Vagrant's website for how to
|
||||||
|
# install vagrant.
|
||||||
|
|
||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
config.vm.synced_folder "..", "/vagrant"
|
||||||
|
|
||||||
|
config.vm.define :freebsd do |bsd|
|
||||||
|
bsd.vm.box = "arkadi/freebsd-10.1-amd64"
|
||||||
|
bsd.vm.provision :shell, inline: 'yes | sudo pkg install rust cargo'
|
||||||
|
bsd.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.memory = "2048"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define :openbsd do |bsd|
|
||||||
|
bsd.vm.box = "bodgit/openbsd-5.7-amd64"
|
||||||
|
bsd.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.memory = "2048"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -20,25 +20,34 @@ install() {
|
||||||
sudo apt-get install $@
|
sudo apt-get install $@
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$TARGET" = "arm-linux-androideabi" ]; then
|
case "$TARGET" in
|
||||||
# Pull a pre-built docker image for testing android, then run tests entirely
|
# Pull a pre-built docker image for testing android, then run tests entirely
|
||||||
# within that image.
|
#d within that image.
|
||||||
|
arm-linux-androideabi)
|
||||||
docker pull alexcrichton/rust-libc-test
|
docker pull alexcrichton/rust-libc-test
|
||||||
exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
|
exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
|
||||||
sh ci/run.sh $TARGET
|
sh ci/run.sh $TARGET
|
||||||
elif [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
|
;;
|
||||||
|
|
||||||
|
x86_64-unknown-linux-musl)
|
||||||
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
||||||
install musl-tools
|
install musl-tools
|
||||||
export CC=musl-gcc
|
export CC=musl-gcc
|
||||||
elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
|
;;
|
||||||
|
|
||||||
|
arm-unknown-linux-gnueabihf)
|
||||||
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
||||||
install gcc-4.7-arm-linux-gnueabihf qemu-user
|
install gcc-4.7-arm-linux-gnueabihf qemu-user
|
||||||
export CC=arm-linux-gnueabihf-gcc-4.7
|
export CC=arm-linux-gnueabihf-gcc-4.7
|
||||||
elif [ "$TARGET" = "aarch64-unknown-linux-gnu" ]; then
|
;;
|
||||||
|
|
||||||
|
aarch64-unknown-linux-gnu)
|
||||||
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
||||||
install gcc-aarch64-linux-gnu qemu-user
|
install gcc-aarch64-linux-gnu qemu-user
|
||||||
export CC=aarch64-linux-gnu-gcc
|
export CC=aarch64-linux-gnu-gcc
|
||||||
elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
|
;;
|
||||||
|
|
||||||
|
mips-unknown-linux-gnu)
|
||||||
# Download pre-built and custom MIPS libs and then also instsall the MIPS
|
# Download pre-built and custom MIPS libs and then also instsall the MIPS
|
||||||
# compiler according to this post:
|
# compiler according to this post:
|
||||||
# http://sathisharada.blogspot.com/2014_10_01_archive.html
|
# http://sathisharada.blogspot.com/2014_10_01_archive.html
|
||||||
|
@ -51,7 +60,9 @@ elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
|
||||||
install emdebian-archive-keyring
|
install emdebian-archive-keyring
|
||||||
install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes
|
install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes
|
||||||
export CC=mips-linux-gnu-gcc
|
export CC=mips-linux-gnu-gcc
|
||||||
else
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
# Download the rustlib folder from the relevant portion of main distribution's
|
# Download the rustlib folder from the relevant portion of main distribution's
|
||||||
# tarballs.
|
# tarballs.
|
||||||
curl -s $MAIN_TARGETS/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz | \
|
curl -s $MAIN_TARGETS/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz | \
|
||||||
|
@ -65,7 +76,9 @@ else
|
||||||
if [ "$TARGET" = "i686-unknown-linux-gnu" ]; then
|
if [ "$TARGET" = "i686-unknown-linux-gnu" ]; then
|
||||||
install gcc-multilib
|
install gcc-multilib
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
cp ci/cargo-config .cargo/config
|
cp ci/cargo-config .cargo/config
|
||||||
|
|
29
ci/run.sh
29
ci/run.sh
|
@ -8,19 +8,28 @@ set -ex
|
||||||
TARGET=$1
|
TARGET=$1
|
||||||
cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
|
cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
|
||||||
|
|
||||||
if [ "$TARGET" = "arm-linux-androideabi" ]; then
|
case "$TARGET" in
|
||||||
|
arm-linux-androideabi)
|
||||||
emulator @test -no-window &
|
emulator @test -no-window &
|
||||||
adb wait-for-device
|
adb wait-for-device
|
||||||
adb push /root/target/$TARGET/debug/libc-test /data/libc-test
|
adb push /root/target/$TARGET/debug/libc-test /data/libc-test
|
||||||
adb shell /data/libc-test
|
adb shell /data/libc-test
|
||||||
elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
|
;;
|
||||||
|
|
||||||
|
arm-unknown-linux-gnueabihf)
|
||||||
qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
|
qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
|
||||||
elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
|
;;
|
||||||
# FIXME: this segfaults on travis, passes locally?
|
|
||||||
#qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/all-*
|
mips-unknown-linux-gnu)
|
||||||
echo skip
|
qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/libc-test
|
||||||
elif [ "$TARGET" = "aarch64-unknown-linux-gnu" ]; then
|
;;
|
||||||
qemu-aarch64 -L /usr/aarch64-linux-gnu/ libc-test/target/$TARGET/debug/libc-test
|
|
||||||
else
|
aarch64-unknown-linux-gnu)
|
||||||
|
qemu-aarch64 -L /usr/aarch64-linux-gnu/ \
|
||||||
|
libc-test/target/$TARGET/debug/libc-test
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
cargo run --manifest-path libc-test/Cargo.toml --target $TARGET
|
cargo run --manifest-path libc-test/Cargo.toml --target $TARGET
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -12,6 +12,8 @@ fn main() {
|
||||||
let android = target.contains("android");
|
let android = target.contains("android");
|
||||||
let darwin = target.contains("apple-darwin");
|
let darwin = target.contains("apple-darwin");
|
||||||
let musl = target.contains("musl");
|
let musl = target.contains("musl");
|
||||||
|
let freebsd = target.contains("freebsd");
|
||||||
|
let bsdlike = freebsd || darwin;
|
||||||
let mut cfg = ctest::TestGenerator::new();
|
let mut cfg = ctest::TestGenerator::new();
|
||||||
|
|
||||||
// Pull in extra goodies on linux/mingw
|
// Pull in extra goodies on linux/mingw
|
||||||
|
@ -39,14 +41,6 @@ fn main() {
|
||||||
.header("time.h")
|
.header("time.h")
|
||||||
.header("wchar.h");
|
.header("wchar.h");
|
||||||
|
|
||||||
if darwin {
|
|
||||||
cfg.header("mach-o/dyld.h");
|
|
||||||
cfg.header("mach/mach_time.h");
|
|
||||||
} else if linux || android {
|
|
||||||
cfg.header("netpacket/packet.h");
|
|
||||||
cfg.header("net/ethernet.h");
|
|
||||||
}
|
|
||||||
|
|
||||||
if windows {
|
if windows {
|
||||||
cfg.header("winsock2.h"); // must be before windows.h
|
cfg.header("winsock2.h"); // must be before windows.h
|
||||||
|
|
||||||
|
@ -84,10 +78,11 @@ fn main() {
|
||||||
cfg.header("utime.h");
|
cfg.header("utime.h");
|
||||||
cfg.header("pwd.h");
|
cfg.header("pwd.h");
|
||||||
cfg.header("grp.h");
|
cfg.header("grp.h");
|
||||||
|
}
|
||||||
|
|
||||||
if android {
|
if android {
|
||||||
cfg.header("arpa/inet.h");
|
cfg.header("arpa/inet.h");
|
||||||
} else {
|
} else if !windows {
|
||||||
cfg.header("glob.h");
|
cfg.header("glob.h");
|
||||||
cfg.header("ifaddrs.h");
|
cfg.header("ifaddrs.h");
|
||||||
|
|
||||||
|
@ -98,17 +93,23 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if darwin {
|
if darwin {
|
||||||
|
cfg.header("mach-o/dyld.h");
|
||||||
|
cfg.header("mach/mach_time.h");
|
||||||
cfg.header("malloc/malloc.h");
|
cfg.header("malloc/malloc.h");
|
||||||
cfg.header("crt_externs.h");
|
cfg.header("crt_externs.h");
|
||||||
} else {
|
|
||||||
cfg.header("malloc.h");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
if linux || android {
|
||||||
if target.contains("linux") {
|
cfg.header("netpacket/packet.h");
|
||||||
|
cfg.header("net/ethernet.h");
|
||||||
|
cfg.header("malloc.h");
|
||||||
cfg.header("sys/prctl.h");
|
cfg.header("sys/prctl.h");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if freebsd {
|
||||||
|
cfg.header("pthread_np.h");
|
||||||
|
}
|
||||||
|
|
||||||
cfg.type_name(move |ty, is_struct| {
|
cfg.type_name(move |ty, is_struct| {
|
||||||
match ty {
|
match ty {
|
||||||
// Just pass all these through, no need for a "struct" prefix
|
// Just pass all these through, no need for a "struct" prefix
|
||||||
|
@ -120,7 +121,7 @@ fn main() {
|
||||||
"ssize_t" if windows => "SSIZE_T".to_string(),
|
"ssize_t" if windows => "SSIZE_T".to_string(),
|
||||||
|
|
||||||
// OSX calls this something else
|
// OSX calls this something else
|
||||||
"sighandler_t" if darwin => "sig_t".to_string(),
|
"sighandler_t" if bsdlike => "sig_t".to_string(),
|
||||||
|
|
||||||
t if t.ends_with("_t") => t.to_string(),
|
t if t.ends_with("_t") => t.to_string(),
|
||||||
|
|
||||||
|
@ -216,7 +217,7 @@ fn main() {
|
||||||
"strerror_r" if linux => true, // actually xpg-something-or-other
|
"strerror_r" if linux => true, // actually xpg-something-or-other
|
||||||
|
|
||||||
// typed 2nd arg on linux and android
|
// typed 2nd arg on linux and android
|
||||||
"gettimeofday" if linux || android => true,
|
"gettimeofday" if linux || android || freebsd => true,
|
||||||
|
|
||||||
"dlerror" if android => true, // const-ness is added
|
"dlerror" if android => true, // const-ness is added
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,5 +2,5 @@ pub const PTHREAD_STACK_MIN: ::size_t = 2048;
|
||||||
pub const KERN_PROC_PATHNAME: ::c_int = 12;
|
pub const KERN_PROC_PATHNAME: ::c_int = 12;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
pub fn __error() -> *const ::c_int;
|
pub fn __error() -> *mut ::c_int;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
pub type pthread_t = uintptr_t;
|
pub type clock_t = i32;
|
||||||
|
pub type dev_t = u32;
|
||||||
|
pub type ino_t = u32;
|
||||||
|
pub type mode_t = u16;
|
||||||
|
pub type nlink_t = u16;
|
||||||
|
pub type blksize_t = u32;
|
||||||
|
pub type fflags_t = u32;
|
||||||
|
pub type pthread_attr_t = *mut ::c_void;
|
||||||
pub type rlim_t = i64;
|
pub type rlim_t = i64;
|
||||||
pub type sighandler_t = size_t;
|
|
||||||
pub type socklen_t = u32;
|
|
||||||
pub type sa_family_t = u8;
|
|
||||||
pub type in_port_t = u16;
|
|
||||||
pub type in_addr_t = u32;
|
|
||||||
pub type pthread_mutex_t = *mut ::c_void;
|
pub type pthread_mutex_t = *mut ::c_void;
|
||||||
pub type pthread_mutexattr_t = *mut ::c_void;
|
pub type pthread_mutexattr_t = *mut ::c_void;
|
||||||
pub type pthread_cond_t = *mut ::c_void;
|
pub type pthread_cond_t = *mut ::c_void;
|
||||||
|
@ -32,7 +34,7 @@ s! {
|
||||||
|
|
||||||
pub struct sockaddr_storage {
|
pub struct sockaddr_storage {
|
||||||
pub ss_len: u8,
|
pub ss_len: u8,
|
||||||
pub ss_family: sa_family_t,
|
pub ss_family: ::sa_family_t,
|
||||||
__ss_pad1: [u8; 6],
|
__ss_pad1: [u8; 6],
|
||||||
__ss_align: i64,
|
__ss_align: i64,
|
||||||
__ss_pad2: [u8; 112],
|
__ss_pad2: [u8; 112],
|
||||||
|
@ -43,41 +45,38 @@ s! {
|
||||||
pub ai_family: ::c_int,
|
pub ai_family: ::c_int,
|
||||||
pub ai_socktype: ::c_int,
|
pub ai_socktype: ::c_int,
|
||||||
pub ai_protocol: ::c_int,
|
pub ai_protocol: ::c_int,
|
||||||
pub ai_addrlen: socklen_t,
|
pub ai_addrlen: ::socklen_t,
|
||||||
pub ai_canonname: *mut c_char,
|
pub ai_canonname: *mut ::c_char,
|
||||||
pub ai_addr: *mut ::sockaddr,
|
pub ai_addr: *mut ::sockaddr,
|
||||||
pub ai_next: *mut addrinfo,
|
pub ai_next: *mut addrinfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
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_dstaddr: *mut ::sockaddr,
|
|
||||||
pub ifa_data: *mut ::c_void
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct sigset_t {
|
pub struct sigset_t {
|
||||||
bits: [u32; 4],
|
bits: [u32; 4],
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct siginfo_t {
|
pub struct siginfo_t {
|
||||||
pub _signo: ::c_int,
|
pub si_signo: ::c_int,
|
||||||
pub _errno: ::c_int,
|
pub si_errno: ::c_int,
|
||||||
pub _code: ::c_int,
|
pub si_code: ::c_int,
|
||||||
pub _pid: ::pid_t,
|
pub si_pid: ::pid_t,
|
||||||
pub _uid: ::uid_t,
|
pub si_uid: ::uid_t,
|
||||||
pub _status: ::c_int,
|
pub si_status: ::c_int,
|
||||||
pub si_addr: *mut ::c_void
|
pub si_addr: *mut ::c_void,
|
||||||
|
_pad: [::c_int; 12],
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct sigaction {
|
pub struct sigaction {
|
||||||
pub sa_sigaction: sighandler_t,
|
pub sa_sigaction: ::sighandler_t,
|
||||||
pub sa_flags: ::c_int,
|
pub sa_flags: ::c_int,
|
||||||
pub sa_mask: sigset_t,
|
pub sa_mask: sigset_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct stack_t {
|
||||||
|
pub ss_sp: *mut ::c_char,
|
||||||
|
pub ss_size: ::size_t,
|
||||||
|
pub ss_flags: ::c_int,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const EXIT_FAILURE: ::c_int = 1;
|
pub const EXIT_FAILURE: ::c_int = 1;
|
||||||
|
@ -90,11 +89,11 @@ pub const SEEK_END: ::c_int = 2;
|
||||||
pub const _IOFBF: ::c_int = 0;
|
pub const _IOFBF: ::c_int = 0;
|
||||||
pub const _IONBF: ::c_int = 2;
|
pub const _IONBF: ::c_int = 2;
|
||||||
pub const _IOLBF: ::c_int = 1;
|
pub const _IOLBF: ::c_int = 1;
|
||||||
pub const BUFSIZ: c_uint = 1024;
|
pub const BUFSIZ: ::c_uint = 1024;
|
||||||
pub const FOPEN_MAX: c_uint = 20;
|
pub const FOPEN_MAX: ::c_uint = 20;
|
||||||
pub const FILENAME_MAX: c_uint = 1024;
|
pub const FILENAME_MAX: ::c_uint = 1024;
|
||||||
pub const L_tmpnam: c_uint = 1024;
|
pub const L_tmpnam: ::c_uint = 1024;
|
||||||
pub const TMP_MAX: c_uint = 308915776;
|
pub const TMP_MAX: ::c_uint = 308915776;
|
||||||
|
|
||||||
pub const O_RDONLY: ::c_int = 0;
|
pub const O_RDONLY: ::c_int = 0;
|
||||||
pub const O_WRONLY: ::c_int = 1;
|
pub const O_WRONLY: ::c_int = 1;
|
||||||
|
@ -492,23 +491,23 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
|
||||||
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
|
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
pub fn mprotect(addr: *const ::c_void, len: size_t, prot: c_int)
|
pub fn mprotect(addr: *const ::c_void, len: size_t, prot: ::c_int)
|
||||||
-> c_int;
|
-> ::c_int;
|
||||||
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
|
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
|
||||||
-> ::c_int;
|
-> ::c_int;
|
||||||
pub fn sysctl(name: *const c_int,
|
pub fn sysctl(name: *const ::c_int,
|
||||||
namelen: c_uint,
|
namelen: ::c_uint,
|
||||||
oldp: *mut ::c_void,
|
oldp: *mut ::c_void,
|
||||||
oldlenp: *mut size_t,
|
oldlenp: *mut size_t,
|
||||||
newp: *const ::c_void,
|
newp: *const ::c_void,
|
||||||
newlen: size_t)
|
newlen: size_t)
|
||||||
-> c_int;
|
-> ::c_int;
|
||||||
pub fn sysctlbyname(name: *const c_char,
|
pub fn sysctlbyname(name: *const ::c_char,
|
||||||
oldp: *mut ::c_void,
|
oldp: *mut ::c_void,
|
||||||
oldlenp: *mut size_t,
|
oldlenp: *mut size_t,
|
||||||
newp: *const ::c_void,
|
newp: *const ::c_void,
|
||||||
newlen: size_t)
|
newlen: size_t)
|
||||||
-> c_int;
|
-> ::c_int;
|
||||||
pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
|
pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
|
||||||
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
|
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,12 @@
|
||||||
pub type c_char = i8;
|
|
||||||
pub type c_schar = i8;
|
|
||||||
pub type c_uchar = u8;
|
|
||||||
pub type c_short = i16;
|
|
||||||
pub type c_ushort = u16;
|
|
||||||
pub type c_int = i32;
|
|
||||||
pub type c_uint = u32;
|
|
||||||
pub type c_long = i32;
|
pub type c_long = i32;
|
||||||
pub type c_ulong = u32;
|
pub type c_ulong = u32;
|
||||||
pub type c_float = f32;
|
|
||||||
pub type c_double = f64;
|
|
||||||
pub type size_t = u32;
|
pub type size_t = u32;
|
||||||
pub type ptrdiff_t = i32;
|
pub type ptrdiff_t = i32;
|
||||||
pub type clock_t = i32;
|
|
||||||
pub type time_t = i32;
|
pub type time_t = i32;
|
||||||
pub type suseconds_t = i32;
|
pub type suseconds_t = i32;
|
||||||
pub type wchar_t = i32;
|
|
||||||
pub type c_longlong = i64;
|
|
||||||
pub type c_ulonglong = u64;
|
|
||||||
pub type intptr_t = i32;
|
pub type intptr_t = i32;
|
||||||
pub type uintptr_t = u32;
|
pub type uintptr_t = u32;
|
||||||
pub type intmax_t = i64;
|
|
||||||
pub type uintmax_t = u64;
|
|
||||||
pub type off_t = i64;
|
|
||||||
pub type dev_t = u32;
|
|
||||||
pub type ino_t = u32;
|
|
||||||
pub type pid_t = i32;
|
|
||||||
pub type uid_t = u32;
|
|
||||||
pub type gid_t = u32;
|
|
||||||
pub type useconds_t = u32;
|
|
||||||
pub type mode_t = u16;
|
|
||||||
pub type ssize_t = i32;
|
pub type ssize_t = i32;
|
||||||
pub type nlink_t = u16;
|
|
||||||
pub type blksize_t = u32;
|
|
||||||
pub type blkcnt_t = i64;
|
|
||||||
pub type fflags_t = u32;
|
|
||||||
pub type pthread_attr_t = *mut c_void;
|
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
|
|
@ -1,40 +1,12 @@
|
||||||
pub type c_char = i8;
|
|
||||||
pub type c_schar = i8;
|
|
||||||
pub type c_uchar = u8;
|
|
||||||
pub type c_short = i16;
|
|
||||||
pub type c_ushort = u16;
|
|
||||||
pub type c_int = i32;
|
|
||||||
pub type c_uint = u32;
|
|
||||||
pub type c_long = i64;
|
pub type c_long = i64;
|
||||||
pub type c_ulong = u64;
|
pub type c_ulong = u64;
|
||||||
pub type c_float = f32;
|
|
||||||
pub type c_double = f64;
|
|
||||||
pub type size_t = u64;
|
pub type size_t = u64;
|
||||||
pub type ptrdiff_t = i64;
|
pub type ptrdiff_t = i64;
|
||||||
pub type clock_t = i32;
|
|
||||||
pub type time_t = i64;
|
pub type time_t = i64;
|
||||||
pub type suseconds_t = i64;
|
pub type suseconds_t = i64;
|
||||||
pub type wchar_t = i32;
|
|
||||||
pub type c_longlong = i64;
|
|
||||||
pub type c_ulonglong = u64;
|
|
||||||
pub type intptr_t = i64;
|
pub type intptr_t = i64;
|
||||||
pub type uintptr_t = u64;
|
pub type uintptr_t = u64;
|
||||||
pub type intmax_t = i64;
|
|
||||||
pub type uintmax_t = u64;
|
|
||||||
pub type off_t = i64;
|
|
||||||
pub type dev_t = u32;
|
|
||||||
pub type ino_t = u32;
|
|
||||||
pub type pid_t = i32;
|
|
||||||
pub type uid_t = u32;
|
|
||||||
pub type gid_t = u32;
|
|
||||||
pub type useconds_t = u32;
|
|
||||||
pub type mode_t = u16;
|
|
||||||
pub type ssize_t = i64;
|
pub type ssize_t = i64;
|
||||||
pub type nlink_t = u16;
|
|
||||||
pub type blksize_t = u32;
|
|
||||||
pub type blkcnt_t = i64;
|
|
||||||
pub type fflags_t = u32;
|
|
||||||
pub type pthread_attr_t = *mut ::c_void;
|
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
pub type c_char = i8;
|
||||||
|
pub type wchar_t = i32;
|
||||||
|
pub type off_t = i64;
|
||||||
|
pub type useconds_t = u32;
|
||||||
|
pub type blkcnt_t = i64;
|
||||||
|
pub type socklen_t = u32;
|
||||||
|
pub type sa_family_t = u8;
|
||||||
|
pub type pthread_t = uintptr_t;
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
pub struct sockaddr {
|
pub struct sockaddr {
|
||||||
pub sa_len: u8,
|
pub sa_len: u8,
|
||||||
|
@ -39,12 +48,19 @@ s! {
|
||||||
pub pw_dir: *mut ::c_char,
|
pub pw_dir: *mut ::c_char,
|
||||||
pub pw_shell: *mut ::c_char,
|
pub pw_shell: *mut ::c_char,
|
||||||
pub pw_expire: ::time_t,
|
pub pw_expire: ::time_t,
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
pub pw_fields: ::c_int,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct stack_t {
|
pub struct ifaddrs {
|
||||||
pub ss_sp: *mut ::c_void,
|
pub ifa_next: *mut ifaddrs,
|
||||||
pub ss_size: ::size_t,
|
pub ifa_name: *mut ::c_char,
|
||||||
pub ss_flags: ::c_int,
|
pub ifa_flags: ::c_uint,
|
||||||
|
pub ifa_addr: *mut ::sockaddr,
|
||||||
|
pub ifa_netmask: *mut ::sockaddr,
|
||||||
|
pub ifa_dstaddr: *mut ::sockaddr,
|
||||||
|
pub ifa_data: *mut ::c_void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,17 +69,19 @@ pub const FIOCLEX: c_ulong = 0x20006601;
|
||||||
pub const SA_ONSTACK: ::c_int = 0x0001;
|
pub const SA_ONSTACK: ::c_int = 0x0001;
|
||||||
pub const SA_SIGINFO: ::c_int = 0x0040;
|
pub const SA_SIGINFO: ::c_int = 0x0040;
|
||||||
|
|
||||||
pub const SIGSTKSZ: ::size_t = 131072;
|
|
||||||
pub const SIGBUS: ::c_int = 10;
|
pub const SIGBUS: ::c_int = 10;
|
||||||
pub const SIG_SETMASK: ::c_int = 3;
|
pub const SIG_SETMASK: ::c_int = 3;
|
||||||
|
|
||||||
|
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
|
||||||
|
pub const IPV6_V6ONLY: ::c_int = 27;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
pub fn mincore(addr: *const ::c_void, len: size_t,
|
pub fn mincore(addr: *const ::c_void, len: size_t,
|
||||||
vec: *mut c_char) -> c_int;
|
vec: *mut c_char) -> ::c_int;
|
||||||
pub fn sysctlnametomib(name: *const c_char,
|
pub fn sysctlnametomib(name: *const c_char,
|
||||||
mibp: *mut c_int,
|
mibp: *mut ::c_int,
|
||||||
sizep: *mut size_t)
|
sizep: *mut size_t)
|
||||||
-> c_int;
|
-> ::c_int;
|
||||||
pub fn setgroups(ngroups: ::c_int,
|
pub fn setgroups(ngroups: ::c_int,
|
||||||
ptr: *const ::gid_t) -> ::c_int;
|
ptr: *const ::gid_t) -> ::c_int;
|
||||||
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
|
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
s! {
|
||||||
|
pub struct glob_t {
|
||||||
|
pub gl_pathc: c_int,
|
||||||
|
pub gl_matchc: c_int,
|
||||||
|
pub gl_offs: c_int,
|
||||||
|
pub gl_flags: c_int,
|
||||||
|
pub gl_pathv: *mut *mut c_char,
|
||||||
|
__unused1: *mut c_void,
|
||||||
|
__unused2: *mut c_void,
|
||||||
|
__unused3: *mut c_void,
|
||||||
|
__unused4: *mut c_void,
|
||||||
|
__unused5: *mut c_void,
|
||||||
|
__unused6: *mut c_void,
|
||||||
|
__unused7: *mut c_void,
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,182 +1,60 @@
|
||||||
pub type sigset_t = libc::c_uint;
|
pub type c_long = i64;
|
||||||
|
pub type c_ulong = u64;
|
||||||
|
pub type size_t = u64;
|
||||||
|
pub type ptrdiff_t = i64;
|
||||||
|
pub type clock_t = i64;
|
||||||
|
pub type time_t = i64;
|
||||||
|
pub type suseconds_t = i64;
|
||||||
|
pub type intptr_t = i64;
|
||||||
|
pub type uintptr_t = u64;
|
||||||
|
pub type dev_t = i32;
|
||||||
|
pub type mode_t = u32;
|
||||||
|
pub type ssize_t = c_long;
|
||||||
|
pub type nlink_t = uint32_t;
|
||||||
|
pub type blksize_t = uint32_t;
|
||||||
|
pub type ino_t = uint64_t;
|
||||||
|
pub type fflags_t = u32;
|
||||||
|
pub type pthread_attr_t = *mut c_void;
|
||||||
|
pub type sigset_t = ::c_uint;
|
||||||
pub type pthread_key_t = ::c_int;
|
pub type pthread_key_t = ::c_int;
|
||||||
struct stack_t {
|
pub type pthread_mutex_t = *mut ::c_void;
|
||||||
ss_sp: *mut libc::c_void,
|
pub type pthread_mutexattr_t = *mut ::c_void;
|
||||||
ss_size: libc::size_t,
|
pub type pthread_cond_t = *mut ::c_void;
|
||||||
ss_flags: libc::c_int,
|
pub type pthread_rwlock_t = *mut ::c_void;
|
||||||
}
|
|
||||||
pub struct siginfo_t {
|
|
||||||
pub si_signo: libc::c_int,
|
|
||||||
pub si_code: libc::c_int,
|
|
||||||
pub si_errno: libc::c_int,
|
|
||||||
pub si_addr: *mut libc::c_void
|
|
||||||
}
|
|
||||||
pub struct sigaction {
|
|
||||||
pub sa_sigaction: sighandler_t,
|
|
||||||
pub sa_mask: sigset_t,
|
|
||||||
pub sa_flags: libc::c_int,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os ="openbsd"))]
|
|
||||||
pub mod os {
|
|
||||||
pub mod common {
|
|
||||||
pub mod posix01 {
|
|
||||||
use types::common::c95::{c_void};
|
|
||||||
use types::os::arch::c95::{c_char, c_int, size_t,
|
|
||||||
time_t, suseconds_t, c_long};
|
|
||||||
use types::os::arch::c99::{uintptr_t};
|
|
||||||
|
|
||||||
pub type pthread_t = uintptr_t;
|
|
||||||
pub type rlim_t = u64;
|
pub type rlim_t = u64;
|
||||||
|
|
||||||
#[cfg(target_os = "bitrig")]
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct glob_t {
|
|
||||||
pub gl_pathc: c_int,
|
|
||||||
pub gl_matchc: c_int,
|
|
||||||
pub gl_offs: c_int,
|
|
||||||
pub gl_flags: c_int,
|
|
||||||
pub gl_pathv: *mut *mut c_char,
|
|
||||||
__unused1: *mut c_void,
|
|
||||||
__unused2: *mut c_void,
|
|
||||||
__unused3: *mut c_void,
|
|
||||||
__unused4: *mut c_void,
|
|
||||||
__unused5: *mut c_void,
|
|
||||||
__unused6: *mut c_void,
|
|
||||||
__unused7: *mut c_void,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(any(target_os = "netbsd", target_os="openbsd"))]
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct glob_t {
|
|
||||||
pub gl_pathc: c_int,
|
|
||||||
__unused1: c_int,
|
|
||||||
pub gl_offs: c_int,
|
|
||||||
__unused2: c_int,
|
|
||||||
pub gl_pathv: *mut *mut c_char,
|
|
||||||
|
|
||||||
__unused3: *mut c_void,
|
|
||||||
|
|
||||||
__unused4: *mut c_void,
|
|
||||||
__unused5: *mut c_void,
|
|
||||||
__unused6: *mut c_void,
|
|
||||||
__unused7: *mut c_void,
|
|
||||||
__unused8: *mut c_void,
|
|
||||||
__unused9: *mut c_void,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct timeval {
|
|
||||||
pub tv_sec: time_t,
|
|
||||||
pub tv_usec: suseconds_t,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct timespec {
|
|
||||||
pub tv_sec: time_t,
|
|
||||||
pub tv_nsec: c_long,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum timezone {}
|
pub enum timezone {}
|
||||||
|
|
||||||
pub type sighandler_t = size_t;
|
s! {
|
||||||
|
pub struct siginfo_t {
|
||||||
#[repr(C)]
|
pub si_signo: ::c_int,
|
||||||
#[derive(Copy, Clone)]
|
pub si_code: ::c_int,
|
||||||
pub struct rlimit {
|
pub si_errno: ::c_int,
|
||||||
pub rlim_cur: rlim_t,
|
pub si_addr: *mut ::c_void
|
||||||
pub rlim_max: rlim_t,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod bsd43 {
|
pub struct sigaction {
|
||||||
use types::os::common::posix01::timeval;
|
pub sa_sigaction: sighandler_t,
|
||||||
use types::os::arch::c95::c_long;
|
pub sa_mask: sigset_t,
|
||||||
#[repr(C)]
|
pub sa_flags: ::c_int,
|
||||||
#[derive(Copy, Clone)]
|
|
||||||
pub struct rusage {
|
|
||||||
pub ru_utime: timeval,
|
|
||||||
pub ru_stime: timeval,
|
|
||||||
pub ru_maxrss: c_long,
|
|
||||||
pub ru_ixrss: c_long,
|
|
||||||
pub ru_idrss: c_long,
|
|
||||||
pub ru_isrss: c_long,
|
|
||||||
pub ru_minflt: c_long,
|
|
||||||
pub ru_majflt: c_long,
|
|
||||||
pub ru_nswap: c_long,
|
|
||||||
pub ru_inblock: c_long,
|
|
||||||
pub ru_oublock: c_long,
|
|
||||||
pub ru_msgsnd: c_long,
|
|
||||||
pub ru_msgrcv: c_long,
|
|
||||||
pub ru_nsignals: c_long,
|
|
||||||
pub ru_nvcsw: c_long,
|
|
||||||
pub ru_nivcsw: c_long
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod bsd44 {
|
pub struct stack_t {
|
||||||
use types::common::c95::{c_void};
|
pub ss_sp: *mut ::c_void,
|
||||||
use types::os::arch::c95::{c_char, c_int, c_uint};
|
pub ss_size: ::size_t,
|
||||||
|
pub ss_flags: ::c_int,
|
||||||
pub type socklen_t = u32;
|
|
||||||
pub type sa_family_t = u8;
|
|
||||||
pub type in_port_t = u16;
|
|
||||||
pub type in_addr_t = u32;
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct sockaddr {
|
|
||||||
pub sa_len: u8,
|
|
||||||
pub sa_family: sa_family_t,
|
|
||||||
pub sa_data: [u8; 14],
|
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy)] pub struct sockaddr_storage {
|
pub struct sockaddr_storage {
|
||||||
pub ss_len: u8,
|
pub ss_len: u8,
|
||||||
pub ss_family: sa_family_t,
|
pub ss_family: sa_family_t,
|
||||||
__ss_pad1: [u8; 6],
|
__ss_pad1: [u8; 6],
|
||||||
__ss_pad2: i64,
|
__ss_pad2: i64,
|
||||||
__ss_pad3: [u8; 240],
|
__ss_pad3: [u8; 240],
|
||||||
}
|
}
|
||||||
impl Clone for sockaddr_storage {
|
|
||||||
fn clone(&self) -> sockaddr_storage { *self }
|
pub struct addrinfo {
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct sockaddr_in {
|
|
||||||
pub sin_len: u8,
|
|
||||||
pub sin_family: sa_family_t,
|
|
||||||
pub sin_port: in_port_t,
|
|
||||||
pub sin_addr: in_addr,
|
|
||||||
pub sin_zero: [u8; 8],
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct in_addr {
|
|
||||||
pub s_addr: in_addr_t,
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct sockaddr_in6 {
|
|
||||||
pub sin6_len: u8,
|
|
||||||
pub sin6_family: sa_family_t,
|
|
||||||
pub sin6_port: in_port_t,
|
|
||||||
pub sin6_flowinfo: u32,
|
|
||||||
pub sin6_addr: in6_addr,
|
|
||||||
pub sin6_scope_id: u32,
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct in6_addr {
|
|
||||||
pub s6_addr: [u16; 8],
|
|
||||||
__align: [u32; 0],
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct ip_mreq {
|
|
||||||
pub imr_multiaddr: in_addr,
|
|
||||||
pub imr_interface: in_addr,
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct ipv6_mreq {
|
|
||||||
pub ipv6mr_multiaddr: in6_addr,
|
|
||||||
pub ipv6mr_interface: c_uint,
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct addrinfo {
|
|
||||||
pub ai_flags: c_int,
|
pub ai_flags: c_int,
|
||||||
pub ai_family: c_int,
|
pub ai_family: c_int,
|
||||||
pub ai_socktype: c_int,
|
pub ai_socktype: c_int,
|
||||||
|
@ -186,84 +64,8 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub ai_canonname: *mut c_char,
|
pub ai_canonname: *mut c_char,
|
||||||
pub ai_next: *mut addrinfo,
|
pub ai_next: *mut addrinfo,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy)] pub struct sockaddr_un {
|
|
||||||
pub sun_len: u8,
|
|
||||||
pub sun_family: sa_family_t,
|
|
||||||
pub sun_path: [c_char; 104]
|
|
||||||
}
|
|
||||||
impl Clone for sockaddr_un {
|
|
||||||
fn clone(&self) -> sockaddr_un { *self }
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] 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_dstaddr: *mut sockaddr,
|
|
||||||
pub ifa_data: *mut c_void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
pub struct stat {
|
||||||
pub mod arch {
|
|
||||||
pub mod c95 {
|
|
||||||
pub type c_char = i8;
|
|
||||||
pub type c_schar = i8;
|
|
||||||
pub type c_uchar = u8;
|
|
||||||
pub type c_short = i16;
|
|
||||||
pub type c_ushort = u16;
|
|
||||||
pub type c_int = i32;
|
|
||||||
pub type c_uint = u32;
|
|
||||||
pub type c_long = i64;
|
|
||||||
pub type c_ulong = u64;
|
|
||||||
pub type c_float = f32;
|
|
||||||
pub type c_double = f64;
|
|
||||||
pub type size_t = u64;
|
|
||||||
pub type ptrdiff_t = i64;
|
|
||||||
pub type clock_t = i64;
|
|
||||||
pub type time_t = i64;
|
|
||||||
pub type suseconds_t = i64;
|
|
||||||
pub type wchar_t = i32;
|
|
||||||
}
|
|
||||||
pub mod c99 {
|
|
||||||
pub type c_longlong = i64;
|
|
||||||
pub type c_ulonglong = u64;
|
|
||||||
pub type intptr_t = i64;
|
|
||||||
pub type uintptr_t = u64;
|
|
||||||
pub type intmax_t = i64;
|
|
||||||
pub type uintmax_t = u64;
|
|
||||||
}
|
|
||||||
pub mod posix88 {
|
|
||||||
use types::os::arch::c95::{c_long};
|
|
||||||
pub type off_t = i64;
|
|
||||||
pub type dev_t = i32;
|
|
||||||
pub type pid_t = i32;
|
|
||||||
pub type uid_t = u32;
|
|
||||||
pub type gid_t = u32;
|
|
||||||
pub type useconds_t = u32;
|
|
||||||
pub type mode_t = u32;
|
|
||||||
pub type ssize_t = c_long;
|
|
||||||
}
|
|
||||||
pub mod posix01 {
|
|
||||||
use types::common::c95::{c_void};
|
|
||||||
use types::common::c99::{uint32_t, uint64_t};
|
|
||||||
use types::os::arch::c95::{c_long, time_t};
|
|
||||||
use types::os::arch::posix88::{dev_t, gid_t};
|
|
||||||
use types::os::arch::posix88::{mode_t, off_t};
|
|
||||||
use types::os::arch::posix88::{uid_t};
|
|
||||||
|
|
||||||
pub type nlink_t = uint32_t;
|
|
||||||
pub type blksize_t = uint32_t;
|
|
||||||
pub type ino_t = uint64_t;
|
|
||||||
pub type blkcnt_t = i64;
|
|
||||||
pub type fflags_t = u32; // type not declared, but struct stat have u_int32_t
|
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct stat {
|
|
||||||
pub st_mode: mode_t,
|
pub st_mode: mode_t,
|
||||||
pub st_dev: dev_t,
|
pub st_dev: dev_t,
|
||||||
pub st_ino: ino_t,
|
pub st_ino: ino_t,
|
||||||
|
@ -285,27 +87,13 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub st_birthtime: time_t,
|
pub st_birthtime: time_t,
|
||||||
pub st_birthtime_nsec: c_long,
|
pub st_birthtime_nsec: c_long,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone)] pub struct utimbuf {
|
|
||||||
pub actime: time_t,
|
|
||||||
pub modtime: time_t,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type pthread_attr_t = *mut c_void;
|
pub struct stack_t {
|
||||||
}
|
pub ss_sp: *mut ::c_void,
|
||||||
pub mod posix08 {
|
pub ss_size: ::size_t,
|
||||||
}
|
pub ss_flags: ::c_int,
|
||||||
pub mod bsd44 {
|
|
||||||
}
|
|
||||||
pub mod extra {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
|
|
||||||
pub mod os {
|
|
||||||
pub mod c95 {
|
|
||||||
use types::os::arch::c95::{c_int, c_uint};
|
|
||||||
|
|
||||||
pub const EXIT_FAILURE : c_int = 1;
|
pub const EXIT_FAILURE : c_int = 1;
|
||||||
pub const EXIT_SUCCESS : c_int = 0;
|
pub const EXIT_SUCCESS : c_int = 0;
|
||||||
|
@ -322,14 +110,6 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const FILENAME_MAX : c_uint = 1024;
|
pub const FILENAME_MAX : c_uint = 1024;
|
||||||
pub const L_tmpnam : c_uint = 1024;
|
pub const L_tmpnam : c_uint = 1024;
|
||||||
pub const TMP_MAX : c_uint = 308915776;
|
pub const TMP_MAX : c_uint = 308915776;
|
||||||
}
|
|
||||||
pub mod c99 {
|
|
||||||
}
|
|
||||||
pub mod posix88 {
|
|
||||||
use types::common::c95::c_void;
|
|
||||||
use types::os::arch::c95::c_int;
|
|
||||||
use types::os::arch::posix88::mode_t;
|
|
||||||
|
|
||||||
pub const O_RDONLY : c_int = 0;
|
pub const O_RDONLY : c_int = 0;
|
||||||
pub const O_WRONLY : c_int = 1;
|
pub const O_WRONLY : c_int = 1;
|
||||||
pub const O_RDWR : c_int = 2;
|
pub const O_RDWR : c_int = 2;
|
||||||
|
@ -497,10 +277,6 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const ENOMSG : c_int = 90;
|
pub const ENOMSG : c_int = 90;
|
||||||
pub const ENOTSUP : c_int = 91;
|
pub const ENOTSUP : c_int = 91;
|
||||||
pub const ELAST : c_int = 91; // must be equal to largest errno
|
pub const ELAST : c_int = 91; // must be equal to largest errno
|
||||||
}
|
|
||||||
pub mod posix01 {
|
|
||||||
use types::os::arch::c95::{c_int, size_t};
|
|
||||||
use types::os::common::posix01::rlim_t;
|
|
||||||
|
|
||||||
pub const F_DUPFD : c_int = 0;
|
pub const F_DUPFD : c_int = 0;
|
||||||
pub const F_GETFD : c_int = 1;
|
pub const F_GETFD : c_int = 1;
|
||||||
|
@ -588,11 +364,6 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const RUSAGE_SELF: c_int = 0;
|
pub const RUSAGE_SELF: c_int = 0;
|
||||||
pub const RUSAGE_CHILDREN: c_int = -1;
|
pub const RUSAGE_CHILDREN: c_int = -1;
|
||||||
pub const RUSAGE_THREAD: c_int = 1;
|
pub const RUSAGE_THREAD: c_int = 1;
|
||||||
}
|
|
||||||
pub mod posix08 {
|
|
||||||
}
|
|
||||||
pub mod bsd44 {
|
|
||||||
use types::os::arch::c95::c_int;
|
|
||||||
|
|
||||||
pub const MADV_NORMAL : c_int = 0;
|
pub const MADV_NORMAL : c_int = 0;
|
||||||
pub const MADV_RANDOM : c_int = 1;
|
pub const MADV_RANDOM : c_int = 1;
|
||||||
|
@ -650,9 +421,6 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const LOCK_EX: c_int = 2;
|
pub const LOCK_EX: c_int = 2;
|
||||||
pub const LOCK_NB: c_int = 4;
|
pub const LOCK_NB: c_int = 4;
|
||||||
pub const LOCK_UN: c_int = 8;
|
pub const LOCK_UN: c_int = 8;
|
||||||
}
|
|
||||||
pub mod extra {
|
|
||||||
use types::os::arch::c95::c_int;
|
|
||||||
|
|
||||||
pub const O_DSYNC : c_int = 128; // same as SYNC
|
pub const O_DSYNC : c_int = 128; // same as SYNC
|
||||||
pub const O_SYNC : c_int = 128;
|
pub const O_SYNC : c_int = 128;
|
||||||
|
@ -669,9 +437,6 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const IPPROTO_RAW : c_int = 255;
|
pub const IPPROTO_RAW : c_int = 255;
|
||||||
|
|
||||||
pub const PATH_MAX: c_int = 1024;
|
pub const PATH_MAX: c_int = 1024;
|
||||||
}
|
|
||||||
pub mod sysconf {
|
|
||||||
use types::os::arch::c95::c_int;
|
|
||||||
|
|
||||||
pub const _SC_ARG_MAX : c_int = 1;
|
pub const _SC_ARG_MAX : c_int = 1;
|
||||||
pub const _SC_CHILD_MAX : c_int = 2;
|
pub const _SC_CHILD_MAX : c_int = 2;
|
||||||
|
@ -725,17 +490,13 @@ pub type pthread_key_t = ::c_int;
|
||||||
pub const _SC_SYNCHRONIZED_IO : c_int = 75;
|
pub const _SC_SYNCHRONIZED_IO : c_int = 75;
|
||||||
pub const _SC_TIMER_MAX : c_int = 93;
|
pub const _SC_TIMER_MAX : c_int = 93;
|
||||||
pub const _SC_TIMERS : c_int = 94;
|
pub const _SC_TIMERS : c_int = 94;
|
||||||
}
|
|
||||||
}
|
|
||||||
pub type pthread_mutex_t = *mut libc::c_void;
|
|
||||||
pub type pthread_mutexattr_t = *mut libc::c_void;
|
|
||||||
pub type pthread_cond_t = *mut libc::c_void;
|
|
||||||
pub type pthread_rwlock_t = *mut libc::c_void;
|
|
||||||
|
|
||||||
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = ptr::null_mut();
|
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
|
||||||
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = ptr::null_mut();
|
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
|
||||||
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = ptr::null_mut();
|
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
|
||||||
pub const PTHREAD_MUTEX_RECURSIVE: libc::c_int = 2;
|
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
|
||||||
|
pub const SIGSTKSZ: ::size_t = 131072;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
pub fn mprotect(addr: *const ::c_void, len: size_t, prot: c_int)
|
pub fn mprotect(addr: *const ::c_void, len: size_t, prot: c_int)
|
||||||
-> c_int;
|
-> c_int;
|
||||||
|
@ -760,4 +521,16 @@ extern {
|
||||||
pub fn pthread_stackseg_np(thread: pthread_t,
|
pub fn pthread_stackseg_np(thread: pthread_t,
|
||||||
sinfo: *mut stack_t) -> ::c_uint;
|
sinfo: *mut stack_t) -> ::c_uint;
|
||||||
pub fn __errno() -> *const ::c_int;
|
pub fn __errno() -> *const ::c_int;
|
||||||
|
pub fn backtrace(buf: *mut *mut ::c_void,
|
||||||
|
sz: ::size_t) -> ::size_t;
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg_if! {
|
||||||
|
if #[cfg(target_os = "bitrig")] {
|
||||||
|
mod bitrig;
|
||||||
|
use self::bitrig::*;
|
||||||
|
} else {
|
||||||
|
mod openbsd;
|
||||||
|
use self::openbsd::*;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
s! {
|
||||||
|
pub struct glob_t {
|
||||||
|
pub gl_pathc: c_int,
|
||||||
|
__unused1: c_int,
|
||||||
|
pub gl_offs: c_int,
|
||||||
|
__unused2: c_int,
|
||||||
|
pub gl_pathv: *mut *mut c_char,
|
||||||
|
|
||||||
|
__unused3: *mut c_void,
|
||||||
|
|
||||||
|
__unused4: *mut c_void,
|
||||||
|
__unused5: *mut c_void,
|
||||||
|
__unused6: *mut c_void,
|
||||||
|
__unused7: *mut c_void,
|
||||||
|
__unused8: *mut c_void,
|
||||||
|
__unused9: *mut c_void,
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,25 @@
|
||||||
//! More functions and definitions can be found in the more specific modules
|
//! More functions and definitions can be found in the more specific modules
|
||||||
//! according to the platform in question.
|
//! according to the platform in question.
|
||||||
|
|
||||||
|
pub type c_schar = i8;
|
||||||
|
pub type c_uchar = u8;
|
||||||
|
pub type c_short = i16;
|
||||||
|
pub type c_ushort = u16;
|
||||||
|
pub type c_int = i32;
|
||||||
|
pub type c_uint = u32;
|
||||||
|
pub type c_float = f32;
|
||||||
|
pub type c_double = f64;
|
||||||
|
pub type c_longlong = i64;
|
||||||
|
pub type c_ulonglong = u64;
|
||||||
|
pub type intmax_t = i64;
|
||||||
|
pub type uintmax_t = u64;
|
||||||
|
pub type pid_t = i32;
|
||||||
|
pub type uid_t = u32;
|
||||||
|
pub type gid_t = u32;
|
||||||
|
pub type in_addr_t = u32;
|
||||||
|
pub type in_port_t = u16;
|
||||||
|
pub type sighandler_t = size_t;
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
pub struct utimbuf {
|
pub struct utimbuf {
|
||||||
pub actime: time_t,
|
pub actime: time_t,
|
||||||
|
@ -493,9 +512,6 @@ extern {
|
||||||
buf: *mut ::c_char,
|
buf: *mut ::c_char,
|
||||||
buflen: ::size_t,
|
buflen: ::size_t,
|
||||||
result: *mut *mut passwd) -> ::c_int;
|
result: *mut *mut passwd) -> ::c_int;
|
||||||
#[cfg(not(target_env = "musl"))]
|
|
||||||
pub fn backtrace(buf: *mut *mut ::c_void,
|
|
||||||
sz: ::c_int) -> ::c_int;
|
|
||||||
pub fn posix_memalign(memptr: *mut *mut ::c_void,
|
pub fn posix_memalign(memptr: *mut *mut ::c_void,
|
||||||
align: ::size_t,
|
align: ::size_t,
|
||||||
size: ::size_t) -> ::c_int;
|
size: ::size_t) -> ::c_int;
|
||||||
|
|
|
@ -14,7 +14,6 @@ pub type ino_t = u32;
|
||||||
pub type ssize_t = i32;
|
pub type ssize_t = i32;
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
pub type blksize_t = i32;
|
pub type blksize_t = i32;
|
||||||
pub type mode_t = u32;
|
|
||||||
pub type nlink_t = u32;
|
pub type nlink_t = u32;
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
|
|
|
@ -4,6 +4,7 @@ pub type useconds_t = u32;
|
||||||
pub type dev_t = u64;
|
pub type dev_t = u64;
|
||||||
pub type socklen_t = u32;
|
pub type socklen_t = u32;
|
||||||
pub type pthread_t = c_ulong;
|
pub type pthread_t = c_ulong;
|
||||||
|
pub type mode_t = u32;
|
||||||
|
|
||||||
s! {
|
s! {
|
||||||
pub struct glob_t {
|
pub struct glob_t {
|
||||||
|
@ -259,6 +260,8 @@ cfg_if! {
|
||||||
newlen: size_t)
|
newlen: size_t)
|
||||||
-> ::c_int;
|
-> ::c_int;
|
||||||
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
|
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
|
||||||
|
pub fn backtrace(buf: *mut *mut ::c_void,
|
||||||
|
sz: ::c_int) -> ::c_int;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ pub type ino_t = u32;
|
||||||
pub type off_t = i32;
|
pub type off_t = i32;
|
||||||
pub type ssize_t = i32;
|
pub type ssize_t = i32;
|
||||||
pub type blkcnt_t = i32;
|
pub type blkcnt_t = i32;
|
||||||
|
|
||||||
pub type blksize_t = i32;
|
pub type blksize_t = i32;
|
||||||
pub type mode_t = u32;
|
|
||||||
pub type nlink_t = u32;
|
pub type nlink_t = u32;
|
||||||
|
|
||||||
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
|
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
//! AArch64-specific definitions for 64-bit linux-like values
|
//! AArch64-specific definitions for 64-bit linux-like values
|
||||||
|
|
||||||
pub type c_char = u8;
|
pub type c_char = u8;
|
||||||
|
pub type wchar_t = u32;
|
||||||
pub type nlink_t = u32;
|
pub type nlink_t = u32;
|
||||||
pub type blksize_t = i32;
|
pub type blksize_t = i32;
|
||||||
pub type wchar_t = u32;
|
|
||||||
|
|
||||||
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48;
|
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48;
|
||||||
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8;
|
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8;
|
||||||
|
|
|
@ -11,7 +11,6 @@ pub type intptr_t = i64;
|
||||||
pub type uintptr_t = u64;
|
pub type uintptr_t = u64;
|
||||||
pub type ino_t = u64;
|
pub type ino_t = u64;
|
||||||
pub type off_t = i64;
|
pub type off_t = i64;
|
||||||
pub type mode_t = u32;
|
|
||||||
pub type ssize_t = i64;
|
pub type ssize_t = i64;
|
||||||
pub type blkcnt_t = i64;
|
pub type blkcnt_t = i64;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
//! x86_64-specific definitions for 64-bit linux-like values
|
//! x86_64-specific definitions for 64-bit linux-like values
|
||||||
|
|
||||||
pub type c_char = i8;
|
pub type c_char = i8;
|
||||||
|
pub type wchar_t = i32;
|
||||||
pub type nlink_t = u64;
|
pub type nlink_t = u64;
|
||||||
pub type blksize_t = i64;
|
pub type blksize_t = i64;
|
||||||
pub type wchar_t = i32;
|
|
||||||
|
|
||||||
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
|
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
|
||||||
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
|
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
|
||||||
|
|
|
@ -1,24 +1,6 @@
|
||||||
pub type c_schar = i8;
|
|
||||||
pub type c_uchar = u8;
|
|
||||||
pub type c_short = i16;
|
|
||||||
pub type c_ushort = u16;
|
|
||||||
pub type c_int = i32;
|
|
||||||
pub type c_uint = u32;
|
|
||||||
pub type c_float = f32;
|
|
||||||
pub type c_double = f64;
|
|
||||||
pub type c_longlong = i64;
|
|
||||||
pub type c_ulonglong = u64;
|
|
||||||
pub type intmax_t = i64;
|
|
||||||
pub type uintmax_t = u64;
|
|
||||||
pub type pid_t = i32;
|
|
||||||
pub type uid_t = u32;
|
|
||||||
pub type gid_t = u32;
|
|
||||||
pub type in_addr_t = u32;
|
|
||||||
pub type in_port_t = u16;
|
|
||||||
pub type rlim_t = c_ulong;
|
pub type rlim_t = c_ulong;
|
||||||
pub type sa_family_t = u16;
|
pub type sa_family_t = u16;
|
||||||
pub type sighandler_t = size_t;
|
pub type pthread_key_t = ::c_uint;
|
||||||
pub type pthread_key_t = c_uint;
|
|
||||||
|
|
||||||
pub enum timezone {}
|
pub enum timezone {}
|
||||||
|
|
||||||
|
@ -58,10 +40,10 @@ s! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
pub ai_flags: c_int,
|
pub ai_flags: ::c_int,
|
||||||
pub ai_family: c_int,
|
pub ai_family: ::c_int,
|
||||||
pub ai_socktype: c_int,
|
pub ai_socktype: ::c_int,
|
||||||
pub ai_protocol: c_int,
|
pub ai_protocol: ::c_int,
|
||||||
pub ai_addrlen: socklen_t,
|
pub ai_addrlen: socklen_t,
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
@ -76,53 +58,53 @@ s! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct sockaddr_ll {
|
pub struct sockaddr_ll {
|
||||||
pub sll_family: c_ushort,
|
pub sll_family: ::c_ushort,
|
||||||
pub sll_protocol: c_ushort,
|
pub sll_protocol: ::c_ushort,
|
||||||
pub sll_ifindex: c_int,
|
pub sll_ifindex: ::c_int,
|
||||||
pub sll_hatype: c_ushort,
|
pub sll_hatype: ::c_ushort,
|
||||||
pub sll_pkttype: c_uchar,
|
pub sll_pkttype: ::c_uchar,
|
||||||
pub sll_halen: c_uchar,
|
pub sll_halen: ::c_uchar,
|
||||||
pub sll_addr: [c_uchar; 8]
|
pub sll_addr: [::c_uchar; 8]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const EXIT_FAILURE: c_int = 1;
|
pub const EXIT_FAILURE: ::c_int = 1;
|
||||||
pub const EXIT_SUCCESS: c_int = 0;
|
pub const EXIT_SUCCESS: ::c_int = 0;
|
||||||
pub const RAND_MAX: c_int = 2147483647;
|
pub const RAND_MAX: ::c_int = 2147483647;
|
||||||
pub const EOF: c_int = -1;
|
pub const EOF: ::c_int = -1;
|
||||||
pub const SEEK_SET: c_int = 0;
|
pub const SEEK_SET: ::c_int = 0;
|
||||||
pub const SEEK_CUR: c_int = 1;
|
pub const SEEK_CUR: ::c_int = 1;
|
||||||
pub const SEEK_END: c_int = 2;
|
pub const SEEK_END: ::c_int = 2;
|
||||||
pub const _IOFBF: c_int = 0;
|
pub const _IOFBF: ::c_int = 0;
|
||||||
pub const _IONBF: c_int = 2;
|
pub const _IONBF: ::c_int = 2;
|
||||||
pub const _IOLBF: c_int = 1;
|
pub const _IOLBF: ::c_int = 1;
|
||||||
|
|
||||||
pub const F_DUPFD: c_int = 0;
|
pub const F_DUPFD: ::c_int = 0;
|
||||||
pub const F_GETFD: c_int = 1;
|
pub const F_GETFD: ::c_int = 1;
|
||||||
pub const F_SETFD: c_int = 2;
|
pub const F_SETFD: ::c_int = 2;
|
||||||
pub const F_GETFL: c_int = 3;
|
pub const F_GETFL: ::c_int = 3;
|
||||||
pub const F_SETFL: c_int = 4;
|
pub const F_SETFL: ::c_int = 4;
|
||||||
|
|
||||||
pub const SIGTRAP: c_int = 5;
|
pub const SIGTRAP: ::c_int = 5;
|
||||||
|
|
||||||
pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
|
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
|
||||||
pub const PTHREAD_CREATE_DETACHED: c_int = 1;
|
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
|
||||||
|
|
||||||
pub const CLOCK_REALTIME: c_int = 0;
|
pub const CLOCK_REALTIME: ::c_int = 0;
|
||||||
pub const CLOCK_MONOTONIC: c_int = 1;
|
pub const CLOCK_MONOTONIC: ::c_int = 1;
|
||||||
|
|
||||||
pub const RLIMIT_CPU: c_int = 0;
|
pub const RLIMIT_CPU: ::c_int = 0;
|
||||||
pub const RLIMIT_FSIZE: c_int = 1;
|
pub const RLIMIT_FSIZE: ::c_int = 1;
|
||||||
pub const RLIMIT_DATA: c_int = 2;
|
pub const RLIMIT_DATA: ::c_int = 2;
|
||||||
pub const RLIMIT_STACK: c_int = 3;
|
pub const RLIMIT_STACK: ::c_int = 3;
|
||||||
pub const RLIMIT_CORE: c_int = 4;
|
pub const RLIMIT_CORE: ::c_int = 4;
|
||||||
pub const RLIMIT_LOCKS: c_int = 10;
|
pub const RLIMIT_LOCKS: ::c_int = 10;
|
||||||
pub const RLIMIT_SIGPENDING: c_int = 11;
|
pub const RLIMIT_SIGPENDING: ::c_int = 11;
|
||||||
pub const RLIMIT_MSGQUEUE: c_int = 12;
|
pub const RLIMIT_MSGQUEUE: ::c_int = 12;
|
||||||
pub const RLIMIT_NICE: c_int = 13;
|
pub const RLIMIT_NICE: ::c_int = 13;
|
||||||
pub const RLIMIT_RTPRIO: c_int = 14;
|
pub const RLIMIT_RTPRIO: ::c_int = 14;
|
||||||
|
|
||||||
pub const RUSAGE_SELF: c_int = 0;
|
pub const RUSAGE_SELF: ::c_int = 0;
|
||||||
|
|
||||||
pub const O_RDONLY: ::c_int = 0;
|
pub const O_RDONLY: ::c_int = 0;
|
||||||
pub const O_WRONLY: ::c_int = 1;
|
pub const O_WRONLY: ::c_int = 1;
|
||||||
|
@ -289,6 +271,9 @@ pub const TCP_INFO: ::c_int = 11;
|
||||||
pub const TCP_QUICKACK: ::c_int = 12;
|
pub const TCP_QUICKACK: ::c_int = 12;
|
||||||
pub const TCP_CONGESTION: ::c_int = 13;
|
pub const TCP_CONGESTION: ::c_int = 13;
|
||||||
|
|
||||||
|
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
|
||||||
|
pub const IPV6_V6ONLY: ::c_int = 26;
|
||||||
|
|
||||||
pub const SO_DEBUG: ::c_int = 1;
|
pub const SO_DEBUG: ::c_int = 1;
|
||||||
|
|
||||||
pub const SHUT_RD: ::c_int = 0;
|
pub const SHUT_RD: ::c_int = 0;
|
||||||
|
|
Loading…
Reference in New Issue