base/sys/unix/
mod.rs

1// Copyright 2023 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5pub mod descriptor;
6pub mod file_traits;
7#[macro_use]
8pub mod handle_eintr;
9mod fcntl;
10mod file_flags;
11mod iobuf;
12pub mod net;
13mod sock_ctrl_msg;
14mod stream_channel;
15pub mod system_info;
16mod time;
17pub mod tube;
18
19pub use descriptor::*;
20pub use fcntl::*;
21pub use file_flags::*;
22pub use iobuf::IoBuf;
23pub use sock_ctrl_msg::*;
24pub use stream_channel::*;
25pub use system_info::iov_max;
26pub use system_info::number_of_logical_cores;
27pub use system_info::number_of_online_cores;
28pub use system_info::pagesize;
29pub use time::duration_to_timespec;
30
31/// Process identifier.
32pub type Pid = libc::pid_t;
33
34#[macro_export]
35macro_rules! syscall {
36    ($e:expr) => {{
37        let res = $e;
38        if res < 0 {
39            $crate::errno_result()
40        } else {
41            Ok(res)
42        }
43    }};
44}