1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use super::{c_int, size_t, c_char, pid_t};

extern "C" {
    pub fn sd_listen_fds(unset_environment: c_int) -> c_int;
    pub fn sd_is_fifo(fd: c_int, path: *const c_char) -> c_int;
    pub fn sd_is_special(fd: c_int, path: *const c_char) -> c_int;
    pub fn sd_is_socket(fd: c_int, family: c_int, sock_type: c_int, listening: c_int) -> c_int;
    pub fn sd_is_socket_inet(fd: c_int,
                             family: c_int,
                             sock_type: c_int,
                             listening: c_int,
                             port: u16)
                             -> c_int;
    pub fn sd_is_socket_unix(fd: c_int,
                             sock_type: c_int,
                             listening: c_int,
                             path: *const c_char,
                             length: size_t)
                             -> c_int;
    pub fn sd_is_mq(fd: c_int, path: *const c_char) -> c_int;
    pub fn sd_notify(unset_environment: c_int, state: *const c_char) -> c_int;
    // skipping sd_*notifyf; ignoring format strings
    pub fn sd_pid_notify(pid: pid_t, unset_environment: c_int, state: *const c_char) -> c_int;
    pub fn sd_booted() -> c_int;
    pub fn sd_watchdog_enabled(unset_environment: c_int, usec: *mut u64) -> c_int;
}