diff options
author | Victor Hsieh <victorhsieh@google.com> | 2020-12-15 13:59:26 -0800 |
---|---|---|
committer | Victor Hsieh <victorhsieh@google.com> | 2021-01-08 08:25:09 -0800 |
commit | 5cc8a92ff386267e0c69f7dad909f5cc3132ebb9 (patch) | |
tree | adf0ed37ac7d7272ca7ba5c1ed11a742e0f3bed6 /src/lib.rs | |
parent | 4061c0fb78928db1e424afbaf808d36800fbbfe7 (diff) | |
download | libchromeos-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.rs | 25 |
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) + } + }}; +} |