2020-08-03 03:09:41 +00:00
|
|
|
// Copyright 2020 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.
|
|
|
|
|
2022-04-04 22:17:20 +00:00
|
|
|
mod alloc;
|
2022-03-28 22:53:02 +00:00
|
|
|
pub mod descriptor;
|
2022-03-28 21:25:20 +00:00
|
|
|
pub mod descriptor_reflection;
|
2022-04-04 22:17:20 +00:00
|
|
|
mod errno;
|
|
|
|
pub mod external_mapping;
|
2022-04-22 20:10:59 +00:00
|
|
|
mod notifiers;
|
2022-04-04 22:17:20 +00:00
|
|
|
pub mod scoped_event_macro;
|
2022-04-13 23:35:10 +00:00
|
|
|
pub mod syslog;
|
2022-04-21 06:01:54 +00:00
|
|
|
mod timer;
|
2022-04-04 22:17:20 +00:00
|
|
|
mod tube;
|
2022-03-21 18:31:38 +00:00
|
|
|
|
2022-04-14 21:01:37 +00:00
|
|
|
pub mod sys;
|
|
|
|
pub use sys::platform;
|
2022-03-21 21:44:36 +00:00
|
|
|
|
2022-04-04 22:17:20 +00:00
|
|
|
pub use alloc::LayoutAllocation;
|
|
|
|
pub use errno::{errno_result, Error, Result};
|
|
|
|
pub use external_mapping::{Error as ExternalMappingError, Result as ExternalMappingResult, *};
|
2022-04-22 20:10:59 +00:00
|
|
|
pub use notifiers::*;
|
2022-04-04 22:17:20 +00:00
|
|
|
pub use scoped_event_macro::*;
|
2022-04-21 06:01:54 +00:00
|
|
|
pub use timer::{FakeTimer, Timer};
|
2022-03-24 17:14:32 +00:00
|
|
|
pub use tube::{Error as TubeError, RecvTube, Result as TubeResult, SendTube, Tube};
|
|
|
|
|
2022-03-21 18:31:38 +00:00
|
|
|
cfg_if::cfg_if! {
|
|
|
|
if #[cfg(unix)] {
|
|
|
|
mod event;
|
|
|
|
mod mmap;
|
|
|
|
mod shm;
|
|
|
|
mod wait_context;
|
|
|
|
|
2022-04-14 21:01:37 +00:00
|
|
|
pub use sys::unix;
|
2022-03-21 18:31:38 +00:00
|
|
|
|
|
|
|
pub use unix::net::*;
|
|
|
|
|
|
|
|
pub use event::{Event, EventReadResult, ScopedEvent};
|
2022-04-22 03:37:09 +00:00
|
|
|
pub use unix::ioctl::{*,
|
2022-03-21 18:31:38 +00:00
|
|
|
ioctl, ioctl_with_mut_ptr, ioctl_with_mut_ref, ioctl_with_ptr, ioctl_with_ref, ioctl_with_val,
|
|
|
|
};
|
|
|
|
pub use mmap::{
|
|
|
|
MemoryMapping, MemoryMappingBuilder, MemoryMappingBuilderUnix, Unix as MemoryMappingUnix,
|
|
|
|
};
|
|
|
|
pub use shm::{SharedMemory, Unix as SharedMemoryUnix};
|
|
|
|
pub use wait_context::{EventToken, EventType, TriggeredEvent, WaitContext};
|
|
|
|
} else if #[cfg(windows)] {
|
2022-04-12 17:03:17 +00:00
|
|
|
pub use tube::{deserialize_and_recv, serialize_and_send, set_duplicate_handle_tube, set_alias_pid, DuplicateHandleTube};
|
2022-03-21 18:31:38 +00:00
|
|
|
} else {
|
|
|
|
compile_error!("Unsupported platform");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-28 22:53:02 +00:00
|
|
|
pub use crate::descriptor::{
|
2022-04-05 21:30:40 +00:00
|
|
|
AsRawDescriptor, AsRawDescriptors, Descriptor, FromRawDescriptor, IntoRawDescriptor,
|
|
|
|
SafeDescriptor,
|
2022-03-28 22:53:02 +00:00
|
|
|
};
|
2022-04-13 23:35:10 +00:00
|
|
|
pub use log::*;
|
2022-03-21 18:31:38 +00:00
|
|
|
pub use platform::*;
|