Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/base/src/sys/unix/mod.rs
5394 views
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
5
pub mod descriptor;
6
pub mod file_traits;
7
#[macro_use]
8
pub mod handle_eintr;
9
mod fcntl;
10
mod file_flags;
11
mod iobuf;
12
pub mod net;
13
mod sock_ctrl_msg;
14
mod stream_channel;
15
pub mod system_info;
16
mod time;
17
pub mod tube;
18
19
pub use descriptor::*;
20
pub use fcntl::*;
21
pub use file_flags::*;
22
pub use iobuf::IoBuf;
23
pub use sock_ctrl_msg::*;
24
pub use stream_channel::*;
25
pub use system_info::iov_max;
26
pub use system_info::number_of_logical_cores;
27
pub use system_info::number_of_online_cores;
28
pub use system_info::pagesize;
29
pub use time::duration_to_timespec;
30
31
/// Process identifier.
32
pub type Pid = libc::pid_t;
33
34
#[macro_export]
35
macro_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
}
45
46