diff options
Diffstat (limited to 'libc/src/unix/haiku')
-rw-r--r-- | libc/src/unix/haiku/mod.rs | 151 |
1 files changed, 135 insertions, 16 deletions
diff --git a/libc/src/unix/haiku/mod.rs b/libc/src/unix/haiku/mod.rs index 829c225..a659f73 100644 --- a/libc/src/unix/haiku/mod.rs +++ b/libc/src/unix/haiku/mod.rs @@ -23,6 +23,7 @@ pub type useconds_t = u32; pub type socklen_t = u32; pub type pthread_t = ::uintptr_t; pub type pthread_mutexattr_t = ::uintptr_t; +pub type pthread_rwlockattr_t = ::uintptr_t; pub type sigset_t = u64; pub type fsblkcnt_t = i64; pub type fsfilcnt_t = i64; @@ -331,8 +332,6 @@ pub const F_SETFD: ::c_int = 0x0004; pub const F_GETFL: ::c_int = 0x0008; pub const F_SETFL: ::c_int = 0x0010; -pub const SIGTRAP: ::c_int = 22; - pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; @@ -401,17 +400,37 @@ pub const X_OK: ::c_int = 1; pub const STDIN_FILENO: ::c_int = 0; pub const STDOUT_FILENO: ::c_int = 1; pub const STDERR_FILENO: ::c_int = 2; + pub const SIGHUP: ::c_int = 1; pub const SIGINT: ::c_int = 2; pub const SIGQUIT: ::c_int = 3; pub const SIGILL: ::c_int = 4; +pub const SIGCHLD: ::c_int = 5; pub const SIGABRT: ::c_int = 6; +pub const SIGPIPE: ::c_int = 7; pub const SIGFPE: ::c_int = 8; pub const SIGKILL: ::c_int = 9; +pub const SIGSTOP: ::c_int = 10; pub const SIGSEGV: ::c_int = 11; -pub const SIGPIPE: ::c_int = 7; +pub const SIGCONT: ::c_int = 12; +pub const SIGTSTP: ::c_int = 13; pub const SIGALRM: ::c_int = 14; pub const SIGTERM: ::c_int = 15; +pub const SIGTTIN: ::c_int = 16; +pub const SIGTTOU: ::c_int = 17; +pub const SIGUSR1: ::c_int = 18; +pub const SIGUSR2: ::c_int = 19; +pub const SIGWINCH: ::c_int = 20; +pub const SIGKILLTHR: ::c_int = 21; +pub const SIGTRAP: ::c_int = 22; +pub const SIGPOLL: ::c_int = 23; +pub const SIGPROF: ::c_int = 24; +pub const SIGSYS: ::c_int = 25; +pub const SIGURG: ::c_int = 26; +pub const SIGVTALRM: ::c_int = 27; +pub const SIGXCPU: ::c_int = 28; +pub const SIGXFSZ: ::c_int = 29; +pub const SIGBUS: ::c_int = 30; pub const EAI_SYSTEM: ::c_int = 11; @@ -536,11 +555,6 @@ pub const AF_UNIX: ::c_int = 9; pub const AF_INET: ::c_int = 1; pub const AF_INET6: ::c_int = 6; pub const SOCK_RAW: ::c_int = 3; -pub const IPPROTO_ICMP: ::c_int = 1; -pub const IPPROTO_ICMPV6: ::c_int = 58; -pub const IPPROTO_TCP: ::c_int = 6; -pub const IPPROTO_IP: ::c_int = 0; -pub const IPPROTO_IPV6: ::c_int = 41; pub const IP_MULTICAST_TTL: ::c_int = 10; pub const IP_MULTICAST_LOOP: ::c_int = 11; pub const IP_TTL: ::c_int = 4; @@ -642,8 +656,6 @@ pub const SA_ONSTACK: c_ulong = 0x20; pub const SA_SIGINFO: c_ulong = 0x40; pub const SA_NOCLDWAIT: c_ulong = 0x02; -pub const SIGCHLD: ::c_int = 5; -pub const SIGBUS: ::c_int = 30; pub const SIG_SETMASK: ::c_int = 3; pub const RUSAGE_CHILDREN: ::c_int = -1; @@ -686,6 +698,60 @@ pub const P_ALL: idtype_t = 0; pub const P_PID: idtype_t = 1; pub const P_PGID: idtype_t = 2; +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VEOF: usize = 4; +pub const VEOL: usize = 5; +pub const VMIN: usize = 4; +pub const VTIME: usize = 5; +pub const VEOL2: usize = 6; +pub const VSWTCH: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o000100; +pub const OFDEL: ::tcflag_t = 0o000200; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const NL0: ::tcflag_t = 0o000000; +pub const NL1: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const CR0: ::tcflag_t = 0o000000; +pub const CR1: ::tcflag_t = 0o001000; +pub const CR2: ::tcflag_t = 0o002000; +pub const CR3: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const TAB0: ::tcflag_t = 0o000000; +pub const TAB1: ::tcflag_t = 0o004000; +pub const TAB2: ::tcflag_t = 0o010000; +pub const TAB3: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const BS0: ::tcflag_t = 0o000000; +pub const BS1: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const FF0: ::tcflag_t = 0o000000; +pub const FF1: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const VT0: ::tcflag_t = 0o000000; +pub const VT1: ::tcflag_t = 0o040000; + +pub const TCGB_CTS: ::c_int = 0x01; +pub const TCGB_DSR: ::c_int = 0x02; +pub const TCGB_RI: ::c_int = 0x04; +pub const TCGB_DCD: ::c_int = 0x08; +pub const TIOCM_CTS: ::c_int = TCGB_CTS; +pub const TIOCM_CD: ::c_int = TCGB_DCD; +pub const TIOCM_CAR: ::c_int = TIOCM_CD; +pub const TIOCM_RI: ::c_int = TCGB_RI; +pub const TIOCM_DSR: ::c_int = TCGB_DSR; +pub const TIOCM_DTR: ::c_int = 0x10; +pub const TIOCM_RTS: ::c_int = 0x20; + f! { pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; @@ -737,18 +803,14 @@ extern { pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t, clock_id: *mut clockid_t) -> ::c_int; pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, - clock_id: clockid_t) -> ::c_int; + clock_id: ::clockid_t) -> ::c_int; pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; - pub fn getpwuid_r(uid: ::uid_t, - pwd: *mut passwd, - buffer: *mut ::c_char, - bufferSize: ::size_t, - result: *mut *mut passwd) -> ::c_int; pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; pub fn getnameinfo(sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, @@ -804,6 +866,63 @@ extern { flags: ::c_int) -> ::ssize_t; pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char, + environment: *const *const ::c_char) -> ::c_int; + #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")] + pub fn getgrgid_r(uid: ::uid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group) -> ::c_int; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "sigaltstack$UNIX2003")] + #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] + pub fn sigaltstack(ss: *const stack_t, + oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")] + pub fn getgrnam_r(name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group) -> ::c_int; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_sigmask$UNIX2003")] + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, + oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] + #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")] + pub fn getpwnam_r(name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] + #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")] + pub fn getpwuid_r(uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd) -> ::c_int; + #[cfg_attr(all(target_os = "macos", target_arch ="x86"), + link_name = "sigwait$UNIX2003")] + #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")] + pub fn sigwait(set: *const sigset_t, + sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork(prepare: Option<unsafe extern fn()>, + parent: Option<unsafe extern fn()>, + child: Option<unsafe extern fn()>) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "popen$UNIX2003")] + pub fn popen(command: *const c_char, + mode: *const c_char) -> *mut ::FILE; } cfg_if! { |