| 1 |
//! This module corresponds to `bootstrap.h` |
| 2 |
|
| 3 |
use boolean::boolean_t; |
| 4 |
use kern_return::kern_return_t; |
| 5 |
use port::mach_port_t; |
| 6 |
|
| 7 |
pub const BOOTSTRAP_MAX_NAME_LEN: ::libc::c_uint = 128; |
| 8 |
pub const BOOTSTRAP_MAX_CMD_LEN: ::libc::c_uint = 512; |
| 9 |
|
| 10 |
pub const BOOTSTRAP_MAX_LOOKUP_COUNT: ::libc::c_uint = 20; |
| 11 |
|
| 12 |
pub const BOOTSTRAP_SUCCESS: ::libc::c_uint = 0; |
| 13 |
pub const BOOTSTRAP_NOT_PRIVILEGED: ::libc::c_uint = 1100; |
| 14 |
pub const BOOTSTRAP_NAME_IN_USE: ::libc::c_uint = 1101; |
| 15 |
pub const BOOTSTRAP_UNKNOWN_SERVICE: ::libc::c_uint = 1102; |
| 16 |
pub const BOOTSTRAP_SERVICE_ACTIVE: ::libc::c_uint = 1103; |
| 17 |
pub const BOOTSTRAP_BAD_COUNT: ::libc::c_uint = 1104; |
| 18 |
pub const BOOTSTRAP_NO_MEMORY: ::libc::c_uint = 1105; |
| 19 |
pub const BOOTSTRAP_NO_CHILDREN: ::libc::c_uint = 1106; |
| 20 |
|
| 21 |
pub const BOOTSTRAP_STATUS_INACTIVE: ::libc::c_uint = 0; |
| 22 |
pub const BOOTSTRAP_STATUS_ACTIVE: ::libc::c_uint = 1; |
| 23 |
pub const BOOTSTRAP_STATUS_ON_DEMAND: ::libc::c_uint = 2; |
| 24 |
|
| 25 |
pub type name_t = [::libc::c_char; 128]; |
| 26 |
pub type cmd_t = [::libc::c_char; 512]; |
| 27 |
pub type name_array_t = *mut name_t; |
| 28 |
pub type bootstrap_status_t = ::libc::c_int; |
| 29 |
pub type bootstrap_status_array_t = *mut bootstrap_status_t; |
| 30 |
pub type bootstrap_property_t = ::libc::c_uint; |
| 31 |
pub type bootstrap_property_array_t = *mut bootstrap_property_t; |
| 32 |
pub type bool_array_t = *mut boolean_t; |
| 33 |
|
| 34 |
extern "C" { |
| 35 |
pub static bootstrap_port: mach_port_t; |
| 36 |
pub fn bootstrap_create_server( |
| 37 |
bp: mach_port_t, |
| 38 |
server_cmd: *mut ::libc::c_char, |
| 39 |
server_uid: ::libc::uid_t, |
| 40 |
on_demand: boolean_t, |
| 41 |
server_port: *mut mach_port_t, |
| 42 |
) -> kern_return_t; |
| 43 |
pub fn bootstrap_subset( |
| 44 |
bp: mach_port_t, |
| 45 |
requestor_port: mach_port_t, |
| 46 |
subset_port: *mut mach_port_t, |
| 47 |
) -> kern_return_t; |
| 48 |
pub fn bootstrap_unprivileged(bp: mach_port_t, unpriv_port: *mut mach_port_t) -> kern_return_t; |
| 49 |
pub fn bootstrap_parent(bp: mach_port_t, parent_port: *mut mach_port_t) -> kern_return_t; |
| 50 |
pub fn bootstrap_register( |
| 51 |
bp: mach_port_t, |
| 52 |
service_name: *mut ::libc::c_char, |
| 53 |
sp: mach_port_t, |
| 54 |
) -> kern_return_t; |
| 55 |
pub fn bootstrap_create_service( |
| 56 |
bp: mach_port_t, |
| 57 |
service_name: *mut ::libc::c_char, |
| 58 |
sp: *mut mach_port_t, |
| 59 |
) -> kern_return_t; |
| 60 |
pub fn bootstrap_check_in( |
| 61 |
bp: mach_port_t, |
| 62 |
service_name: *const ::libc::c_char, |
| 63 |
sp: *mut mach_port_t, |
| 64 |
) -> kern_return_t; |
| 65 |
pub fn bootstrap_look_up( |
| 66 |
bp: mach_port_t, |
| 67 |
service_name: *const ::libc::c_char, |
| 68 |
sp: *mut mach_port_t, |
| 69 |
) -> kern_return_t; |
| 70 |
pub fn bootstrap_status( |
| 71 |
bp: mach_port_t, |
| 72 |
service_name: *mut ::libc::c_char, |
| 73 |
service_active: *mut bootstrap_status_t, |
| 74 |
) -> kern_return_t; |
| 75 |
pub fn bootstrap_strerror(r: kern_return_t) -> *const ::libc::c_char; |
| 76 |
} |