aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVictor Hsieh <victorhsieh@google.com>2020-12-15 13:59:26 -0800
committerVictor Hsieh <victorhsieh@google.com>2021-01-08 08:25:09 -0800
commit5cc8a92ff386267e0c69f7dad909f5cc3132ebb9 (patch)
treeadf0ed37ac7d7272ca7ba5c1ed11a742e0f3bed6 /src/lib.rs
parent4061c0fb78928db1e424afbaf808d36800fbbfe7 (diff)
downloadlibchromeos-rs-5cc8a92ff386267e0c69f7dad909f5cc3132ebb9.tar.gz
Import libchromeos-rs
This change is imported from the libchromeos-rs directory of https://chromium.googlesource.com/chromiumos/platform2 Extra files added: - Android.bp - patches/Android.bp.patch File modified: - OWNERS Bug: 174797066 Test: mma Change-Id: I473686bb8dd9633759e6fb58266c9750322d52f2
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..9d34580
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,25 @@
+// Copyright 2019 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+pub mod linux;
+pub mod net;
+mod read_dir;
+pub mod scoped_path;
+pub mod sync;
+pub mod syslog;
+pub mod vsock;
+
+pub use read_dir::*;
+
+#[macro_export]
+macro_rules! syscall {
+ ($e:expr) => {{
+ let res = $e;
+ if res < 0 {
+ Err(::std::io::Error::last_os_error())
+ } else {
+ Ok(res)
+ }
+ }};
+}