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::pagesize;
28pub use time::duration_to_timespec;
29
30/// Process identifier.
31pub type Pid = libc::pid_t;
32
33#[macro_export]
34macro_rules! syscall {
35    ($e:expr) => {{
36        let res = $e;
37        if res < 0 {
38            $crate::errno_result()
39        } else {
40            Ok(res)
41        }
42    }};
43}