]> git.proxmox.com Git - rustc.git/blobdiff - src/liblibc/src/unix/bsd/apple/mod.rs
New upstream version 1.13.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / apple / mod.rs
index 967be9417fd43ed48386e7a431c23a3ab0db2e54..aa4d1ac74575e9f96fac8ec3313765ce54b243a1 100644 (file)
@@ -25,6 +25,17 @@ pub type sem_t = ::c_int;
 pub enum timezone {}
 
 s! {
+    pub struct utmpx {
+        pub ut_user: [::c_char; _UTX_USERSIZE],
+        pub ut_id: [::c_char; _UTX_IDSIZE],
+        pub ut_line: [::c_char; _UTX_LINESIZE],
+        pub ut_pid: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_host: [::c_char; _UTX_HOSTSIZE],
+        ut_pad: [::uint32_t; 16],
+    }
+
     pub struct glob_t {
         pub gl_pathc:  ::size_t,
         __unused1: ::c_int,
@@ -294,6 +305,24 @@ s! {
     }
 }
 
+pub const _UTX_USERSIZE: usize = 256;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 256;
+
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const OLD_TIME: ::c_short = 3;
+pub const NEW_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+pub const SIGNATURE: ::c_short = 10;
+pub const SHUTDOWN_TIME: ::c_short = 11;
+
 pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
 pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
 pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
@@ -592,6 +621,8 @@ pub const EOWNERDEAD: ::c_int = 105;
 pub const EQFULL: ::c_int = 106;
 pub const ELAST: ::c_int = 106;
 
+pub const EAI_SYSTEM: ::c_int = 11;
+
 pub const F_DUPFD: ::c_int = 0;
 pub const F_DUPFD_CLOEXEC: ::c_int = 67;
 pub const F_GETFD: ::c_int = 1;
@@ -972,46 +1003,78 @@ pub const FD_SETSIZE: usize = 1024;
 
 pub const ST_NOSUID: ::c_ulong = 2;
 
-pub const EVFILT_AIO: ::int16_t = 0xfffd;
-pub const EVFILT_PROC: ::int16_t = 0xfffb;
-pub const EVFILT_READ: ::int16_t = 0xffff;
-pub const EVFILT_SIGNAL: ::int16_t = 0xfffa;
-pub const EVFILT_SYSCOUNT: ::int16_t = 0xe;
-pub const EVFILT_TIMER: ::int16_t = 0xfff9;
-pub const EVFILT_VNODE: ::int16_t = 0xfffc;
-pub const EVFILT_WRITE: ::int16_t = 0xfffe;
-pub const EVFILT_FS: ::int16_t = 0xfff7;
-pub const EVFILT_MACHPORT: ::int16_t = 0xfff8;
-pub const EVFILT_USER: ::int16_t = 0xfff6;
-pub const EVFILT_VM: ::int16_t = 0xfff4;
-
+pub const EVFILT_READ: ::int16_t = -1;
+pub const EVFILT_WRITE: ::int16_t = -2;
+pub const EVFILT_AIO: ::int16_t = -3;
+pub const EVFILT_VNODE: ::int16_t = -4;
+pub const EVFILT_PROC: ::int16_t = -5;
+pub const EVFILT_SIGNAL: ::int16_t = -6;
+pub const EVFILT_TIMER: ::int16_t = -7;
+pub const EVFILT_MACHPORT: ::int16_t = -8;
+pub const EVFILT_FS: ::int16_t = -9;
+pub const EVFILT_USER: ::int16_t = -10;
+pub const EVFILT_VM: ::int16_t = -12;
+
+pub const EV_ADD: ::uint16_t = 0x1;
+pub const EV_DELETE: ::uint16_t = 0x2;
+pub const EV_ENABLE: ::uint16_t = 0x4;
+pub const EV_DISABLE: ::uint16_t = 0x8;
+pub const EV_ONESHOT: ::uint16_t = 0x10;
+pub const EV_CLEAR: ::uint16_t = 0x20;
+pub const EV_RECEIPT: ::uint16_t = 0x40;
 pub const EV_DISPATCH: ::uint16_t = 0x80;
 pub const EV_FLAG0: ::uint16_t = 0x1000;
-pub const EV_OOBAND: ::uint16_t = 0x2000;
 pub const EV_POLL: ::uint16_t = 0x1000;
-pub const EV_RECEIPT: ::uint16_t = 0x40;
+pub const EV_FLAG1: ::uint16_t = 0x2000;
+pub const EV_OOBAND: ::uint16_t = 0x2000;
+pub const EV_ERROR: ::uint16_t = 0x4000;
+pub const EV_EOF: ::uint16_t = 0x8000;
+pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
 
-pub const NOTE_ABSOLUTE: ::uint32_t = 0x8;
-pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000;
-pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000;
+pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
+pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
 pub const NOTE_FFAND: ::uint32_t = 0x40000000;
+pub const NOTE_FFOR: ::uint32_t = 0x80000000;
 pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
 pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
 pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
-pub const NOTE_FFNOP: ::uint32_t = 0x0;
-pub const NOTE_FFOR: ::uint32_t = 0x80000000;
-pub const NOTE_NONE: ::uint32_t = 0x80;
-pub const NOTE_NSECONDS: ::uint32_t = 0x4;
+pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
+pub const NOTE_DELETE: ::uint32_t = 0x00000001;
+pub const NOTE_WRITE: ::uint32_t = 0x00000002;
+pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
+pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
+pub const NOTE_LINK: ::uint32_t = 0x00000010;
+pub const NOTE_RENAME: ::uint32_t = 0x00000020;
+pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
+pub const NOTE_NONE: ::uint32_t = 0x00000080;
+pub const NOTE_EXIT: ::uint32_t = 0x80000000;
+pub const NOTE_FORK: ::uint32_t = 0x40000000;
+pub const NOTE_EXEC: ::uint32_t = 0x20000000;
 pub const NOTE_REAP: ::uint32_t = 0x10000000;
-pub const NOTE_SECONDS: ::uint32_t = 0x1;
-pub const NOTE_SIGNAL: ::uint32_t = 0x8000000;
-pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
-pub const NOTE_USECONDS: ::uint32_t = 0x2;
-pub const NOTE_VM_ERROR: ::uint32_t = 0x10000000;
+pub const NOTE_SIGNAL: ::uint32_t = 0x08000000;
+pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000;
+pub const NOTE_EXIT_DETAIL: ::uint32_t = 0x02000000;
+pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
+pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000;
+pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000;
+pub const NOTE_EXIT_DETAIL_MASK: ::uint32_t = 0x00070000;
+pub const NOTE_EXIT_DECRYPTFAIL: ::uint32_t = 0x00010000;
+pub const NOTE_EXIT_MEMORY: ::uint32_t = 0x00020000;
+pub const NOTE_EXIT_CSERROR: ::uint32_t = 0x00040000;
 pub const NOTE_VM_PRESSURE: ::uint32_t = 0x80000000;
-pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: ::uint32_t = 0x20000000;
 pub const NOTE_VM_PRESSURE_TERMINATE: ::uint32_t = 0x40000000;
-pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000;
+pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: ::uint32_t = 0x20000000;
+pub const NOTE_VM_ERROR: ::uint32_t = 0x10000000;
+pub const NOTE_SECONDS: ::uint32_t = 0x00000001;
+pub const NOTE_USECONDS: ::uint32_t = 0x00000002;
+pub const NOTE_NSECONDS: ::uint32_t = 0x00000004;
+pub const NOTE_ABSOLUTE: ::uint32_t = 0x00000008;
+pub const NOTE_LEEWAY: ::uint32_t = 0x00000010;
+pub const NOTE_CRITICAL: ::uint32_t = 0x00000020;
+pub const NOTE_BACKGROUND: ::uint32_t = 0x00000040;
+pub const NOTE_TRACK: ::uint32_t = 0x00000001;
+pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
+pub const NOTE_CHILD: ::uint32_t = 0x00000004;
 
 pub const NL0: ::c_int  = 0x00000000;
 pub const NL1: ::c_int  = 0x00000100;
@@ -1256,6 +1319,11 @@ pub const CTL_DEBUG_NAME: ::c_int = 0;
 pub const CTL_DEBUG_VALUE: ::c_int = 1;
 pub const CTL_DEBUG_MAXID: ::c_int = 20;
 
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLRDBAND: ::c_short = 0x080;
+pub const POLLWRBAND: ::c_short = 0x100;
+
 pub const PRIO_DARWIN_THREAD: ::c_int = 3;
 pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
 pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
@@ -1286,6 +1354,16 @@ f! {
 }
 
 extern {
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+
     pub fn getnameinfo(sa: *const ::sockaddr,
                        salen: ::socklen_t,
                        host: *mut ::c_char,