Format after patches have been applied
This commit is contained in:
parent
7f6ee12526
commit
d633d8e074
4 changed files with 17 additions and 13 deletions
|
@ -4,15 +4,20 @@
|
||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
|
use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
|
||||||
|
#[cfg(not(target_os = "trusty"))]
|
||||||
|
use crate::fs;
|
||||||
use crate::marker::PhantomData;
|
use crate::marker::PhantomData;
|
||||||
use crate::mem::ManuallyDrop;
|
use crate::mem::ManuallyDrop;
|
||||||
#[cfg(not(any(target_arch = "wasm32", target_env = "sgx", target_os = "hermit", target_os = "trusty")))]
|
#[cfg(not(any(
|
||||||
|
target_arch = "wasm32",
|
||||||
|
target_env = "sgx",
|
||||||
|
target_os = "hermit",
|
||||||
|
target_os = "trusty"
|
||||||
|
)))]
|
||||||
use crate::sys::cvt;
|
use crate::sys::cvt;
|
||||||
#[cfg(not(target_os = "trusty"))]
|
#[cfg(not(target_os = "trusty"))]
|
||||||
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
||||||
use crate::{fmt, io};
|
use crate::{fmt, io};
|
||||||
#[cfg(not(target_os = "trusty"))]
|
|
||||||
use crate::fs;
|
|
||||||
|
|
||||||
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
|
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#[cfg(target_os = "hermit")]
|
#[cfg(target_os = "hermit")]
|
||||||
use hermit_abi as libc;
|
use hermit_abi as libc;
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "trusty"))]
|
||||||
|
use crate::fs;
|
||||||
|
use crate::io;
|
||||||
#[cfg(target_os = "hermit")]
|
#[cfg(target_os = "hermit")]
|
||||||
use crate::os::hermit::io::OwnedFd;
|
use crate::os::hermit::io::OwnedFd;
|
||||||
#[cfg(not(target_os = "hermit"))]
|
#[cfg(not(target_os = "hermit"))]
|
||||||
|
@ -17,9 +20,6 @@ use crate::os::unix::io::OwnedFd;
|
||||||
use crate::os::wasi::io::OwnedFd;
|
use crate::os::wasi::io::OwnedFd;
|
||||||
#[cfg(not(target_os = "trusty"))]
|
#[cfg(not(target_os = "trusty"))]
|
||||||
use crate::sys_common::{AsInner, IntoInner};
|
use crate::sys_common::{AsInner, IntoInner};
|
||||||
#[cfg(not(target_os = "trusty"))]
|
|
||||||
use crate::fs;
|
|
||||||
use crate::io;
|
|
||||||
|
|
||||||
/// Raw file descriptors.
|
/// Raw file descriptors.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
#[path = "../unsupported/args.rs"]
|
#[path = "../unsupported/args.rs"]
|
||||||
pub mod args;
|
pub mod args;
|
||||||
|
#[path = "../unsupported/common.rs"]
|
||||||
|
#[deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
mod common;
|
||||||
#[path = "../unsupported/env.rs"]
|
#[path = "../unsupported/env.rs"]
|
||||||
pub mod env;
|
pub mod env;
|
||||||
#[path = "../unsupported/fs.rs"]
|
#[path = "../unsupported/fs.rs"]
|
||||||
|
@ -17,12 +20,9 @@ pub mod pipe;
|
||||||
#[path = "../unsupported/process.rs"]
|
#[path = "../unsupported/process.rs"]
|
||||||
pub mod process;
|
pub mod process;
|
||||||
pub mod stdio;
|
pub mod stdio;
|
||||||
#[path = "../unsupported/time.rs"]
|
|
||||||
pub mod time;
|
|
||||||
#[path = "../unsupported/thread.rs"]
|
#[path = "../unsupported/thread.rs"]
|
||||||
pub mod thread;
|
pub mod thread;
|
||||||
#[path = "../unsupported/common.rs"]
|
#[path = "../unsupported/time.rs"]
|
||||||
#[deny(unsafe_op_in_unsafe_fn)]
|
pub mod time;
|
||||||
mod common;
|
|
||||||
|
|
||||||
pub use common::*;
|
pub use common::*;
|
||||||
|
|
|
@ -59,8 +59,7 @@ pub fn panic_output() -> Option<impl io::Write> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn _write(fd: i32, message: &[u8]) -> io::Result<usize> {
|
fn _write(fd: i32, message: &[u8]) -> io::Result<usize> {
|
||||||
let mut iov =
|
let mut iov = libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() };
|
||||||
libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() };
|
|
||||||
loop {
|
loop {
|
||||||
// SAFETY: syscall, safe arguments.
|
// SAFETY: syscall, safe arguments.
|
||||||
let ret = unsafe { libc::writev(fd, &iov, 1) };
|
let ret = unsafe { libc::writev(fd, &iov, 1) };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue