summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/unix/fd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/unix/fd.rs')
-rw-r--r--library/std/src/sys/unix/fd.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs
index ce5c048f2..cb630eede 100644
--- a/library/std/src/sys/unix/fd.rs
+++ b/library/std/src/sys/unix/fd.rs
@@ -75,6 +75,7 @@ const fn max_iov() -> usize {
target_os = "nto",
target_os = "openbsd",
target_os = "horizon",
+ target_os = "vita",
target_os = "watchos",
)))]
const fn max_iov() -> usize {
@@ -93,7 +94,7 @@ impl FileDesc {
Ok(ret as usize)
}
- #[cfg(not(any(target_os = "espidf", target_os = "horizon")))]
+ #[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
let ret = cvt(unsafe {
libc::readv(
@@ -105,14 +106,14 @@ impl FileDesc {
Ok(ret as usize)
}
- #[cfg(any(target_os = "espidf", target_os = "horizon"))]
+ #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
io::default_read_vectored(|b| self.read(b), bufs)
}
#[inline]
pub fn is_read_vectored(&self) -> bool {
- cfg!(not(any(target_os = "espidf", target_os = "horizon")))
+ cfg!(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))
}
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
@@ -253,7 +254,7 @@ impl FileDesc {
Ok(ret as usize)
}
- #[cfg(not(any(target_os = "espidf", target_os = "horizon")))]
+ #[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
let ret = cvt(unsafe {
libc::writev(
@@ -265,14 +266,14 @@ impl FileDesc {
Ok(ret as usize)
}
- #[cfg(any(target_os = "espidf", target_os = "horizon"))]
+ #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))]
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
io::default_write_vectored(|b| self.write(b), bufs)
}
#[inline]
pub fn is_write_vectored(&self) -> bool {
- cfg!(not(any(target_os = "espidf", target_os = "horizon")))
+ cfg!(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))
}
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
@@ -481,6 +482,7 @@ impl<'a> Read for &'a FileDesc {
}
impl AsInner<OwnedFd> for FileDesc {
+ #[inline]
fn as_inner(&self) -> &OwnedFd {
&self.0
}
@@ -505,6 +507,7 @@ impl AsFd for FileDesc {
}
impl AsRawFd for FileDesc {
+ #[inline]
fn as_raw_fd(&self) -> RawFd {
self.0.as_raw_fd()
}