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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2023 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

pub mod descriptor;
pub mod file_traits;
#[macro_use]
pub mod handle_eintr;
mod fcntl;
mod file_flags;
mod iobuf;
pub mod net;
mod sock_ctrl_msg;
mod stream_channel;
pub mod system_info;
mod time;
pub mod tube;

pub use descriptor::*;
pub use fcntl::*;
pub use file_flags::*;
pub use iobuf::IoBuf;
pub use sock_ctrl_msg::*;
pub use stream_channel::*;
pub use system_info::iov_max;
pub use system_info::number_of_logical_cores;
pub use system_info::pagesize;
pub use time::duration_to_timespec;

/// Process identifier.
pub type Pid = libc::pid_t;

#[macro_export]
macro_rules! syscall {
    ($e:expr) => {{
        let res = $e;
        if res < 0 {
            $crate::errno_result()
        } else {
            Ok(res)
        }
    }};
}