/// ```
#[derive(Clone, Debug)]
pub struct OpenOptions {
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
read_write: bool,
unchecked: bool,
}
/// All options are initially set to `false`.
pub fn new() -> OpenOptions {
OpenOptions {
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
read_write: false,
unchecked: false,
}
/// .read_write(true)
/// .open_receiver("path/to/a/fifo");
/// ```
- #[cfg(target_os = "linux")]
- #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
+ #[cfg_attr(docsrs, doc(cfg(any(target_os = "linux", target_os = "android"))))]
pub fn read_write(&mut self, value: bool) -> &mut Self {
self.read_write = value;
self
.write(pipe_end == PipeEnd::Sender)
.custom_flags(libc::O_NONBLOCK);
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
if self.read_write {
options.read(true).write(true);
}
}
#[tokio::test]
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg_attr(miri, ignore)] // No `mkfifo` in miri.
async fn fifo_simple_send_sender_first() -> io::Result<()> {
const DATA: &[u8] = b"this is some data to write to the fifo";
/// Checks behavior of a resilient reader (Receiver in O_RDWR access mode)
/// with writers sequentially opening and closing a FIFO.
#[tokio::test]
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg_attr(miri, ignore)] // No `socket` in miri.
async fn fifo_resilient_reader() -> io::Result<()> {
const DATA: &[u8] = b"this is some data to write to the fifo";