Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changes from 0.38.x to 1.0

`rustix::thread::FutexOperation` and `rustix::thread::futex` are removed. Use
the functions in the `rustix::thread::futex` module instead.

`rustix::process::waitpid`'s return type changed from `WaitStatus` to
`(Pid, WaitStatus)`, to additionally return the pid of the child.

The "cc" feature is removed. It hasn't had any effect for several
major releases.

All explicitly deprecated functions and types have been removed. Their
deprecation messages will have identified alternatives.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ rustc-dep-of-std = [
"compiler_builtins?/rustc-dep-of-std",
]

# Obsolete and deprecated.
cc = []

# Enable `rustix::io::try_close`. The rustix developers do not intend the
# existence of this feature to imply that anyone should use it.
try_close = []
Expand Down
3 changes: 0 additions & 3 deletions src/backend/libc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ pub(crate) mod mm;
#[cfg(linux_kernel)]
#[cfg(feature = "mount")]
pub(crate) mod mount;
#[cfg(linux_kernel)]
#[cfg(all(feature = "fs", not(feature = "mount")))]
pub(crate) mod mount; // for deprecated mount functions in "fs"
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(feature = "net")]
pub(crate) mod net;
Expand Down
6 changes: 0 additions & 6 deletions src/backend/libc/net/send_recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ bitflags! {
/// `MSG_DONTWAIT`
#[cfg(not(windows))]
const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
/// Deprecated alias for [`EOR`].
///
/// [`EOR`]: Self::EOR
#[cfg(not(windows))]
#[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
const EOT = bitcast!(c::MSG_EOR);
/// `MSG_EOR`
#[cfg(not(windows))]
const EOR = bitcast!(c::MSG_EOR);
Expand Down
4 changes: 2 additions & 2 deletions src/backend/libc/shm/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use crate::backend::conv::{c_str, ret, ret_owned_fd};
use crate::fd::OwnedFd;
use crate::fs::Mode;
use crate::io;
use crate::shm::ShmOFlags;
use crate::shm;

pub(crate) fn shm_open(name: &CStr, oflags: ShmOFlags, mode: Mode) -> io::Result<OwnedFd> {
pub(crate) fn shm_open(name: &CStr, oflags: shm::OFlags, mode: Mode) -> io::Result<OwnedFd> {
// On this platforms, `mode_t` is `u16` and can't be passed directly to a
// variadic function.
#[cfg(apple)]
Expand Down
38 changes: 0 additions & 38 deletions src/backend/libc/thread/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,44 +48,6 @@ pub(crate) enum Operation {
LockPi2 = bitcast!(c::FUTEX_LOCK_PI2),
}

/// `FUTEX_*` operations for use with the [`futex`] function.
///
/// [`futex`]: fn@crate::thread::futex
// TODO: Deprecate this now that we have a new typed API.
/*
#[deprecated(
since = "0.38.35",
note = "
The `futex` function and `FutexOperation` enum are deprecated. There are
individual functions available to perform futex operations with improved
type safety. See the `rustix::thread::futex` module."
)]
*/
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum FutexOperation {
/// `FUTEX_WAIT`
Wait = bitcast!(c::FUTEX_WAIT),
/// `FUTEX_WAKE`
Wake = bitcast!(c::FUTEX_WAKE),
/// `FUTEX_FD`
Fd = bitcast!(c::FUTEX_FD),
/// `FUTEX_REQUEUE`
Requeue = bitcast!(c::FUTEX_REQUEUE),
/// `FUTEX_CMP_REQUEUE`
CmpRequeue = bitcast!(c::FUTEX_CMP_REQUEUE),
/// `FUTEX_WAKE_OP`
WakeOp = bitcast!(c::FUTEX_WAKE_OP),
/// `FUTEX_LOCK_PI`
LockPi = bitcast!(c::FUTEX_LOCK_PI),
/// `FUTEX_UNLOCK_PI`
UnlockPi = bitcast!(c::FUTEX_UNLOCK_PI),
/// `FUTEX_TRYLOCK_PI`
TrylockPi = bitcast!(c::FUTEX_TRYLOCK_PI),
/// `FUTEX_WAIT_BITSET`
WaitBitset = bitcast!(c::FUTEX_WAIT_BITSET),
}

/// `FUTEX_WAITERS`
pub const WAITERS: u32 = linux_raw_sys::general::FUTEX_WAITERS;

Expand Down
6 changes: 2 additions & 4 deletions src/backend/linux_raw/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,15 @@ pub(crate) mod fs {
}
}

#[cfg(any(feature = "fs", feature = "mount"))]
#[cfg(feature = "mount")]
impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountFlagsArg> for ArgReg<'a, Num> {
#[inline]
fn from(flags: crate::backend::mount::types::MountFlagsArg) -> Self {
c_uint(flags.0)
}
}

// When the deprecated "fs" aliases are removed, we can remove the "fs"
// here too.
#[cfg(any(feature = "fs", feature = "mount"))]
#[cfg(feature = "mount")]
impl<'a, Num: ArgNumber> From<crate::backend::mount::types::UnmountFlags> for ArgReg<'a, Num> {
#[inline]
fn from(flags: crate::backend::mount::types::UnmountFlags) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions src/backend/linux_raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ pub(crate) mod io_uring;
pub(crate) mod mm;
#[cfg(feature = "mount")]
pub(crate) mod mount;
#[cfg(all(feature = "fs", not(feature = "mount")))]
pub(crate) mod mount; // for deprecated mount functions in "fs"
#[cfg(feature = "net")]
pub(crate) mod net;
#[cfg(any(
Expand Down
5 changes: 0 additions & 5 deletions src/backend/linux_raw/net/send_recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ bitflags! {
const DONTROUTE = c::MSG_DONTROUTE;
/// `MSG_DONTWAIT`
const DONTWAIT = c::MSG_DONTWAIT;
/// Deprecated alias for [`EOR`].
///
/// [`EOR`]: Self::EOR
#[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
const EOT = c::MSG_EOR;
/// `MSG_EOR`
const EOR = c::MSG_EOR;
/// `MSG_MORE`
Expand Down
4 changes: 2 additions & 2 deletions src/backend/linux_raw/shm/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::backend::fs::syscalls::{open, unlink};
use crate::backend::fs::types::{Mode, OFlags};
use crate::fd::OwnedFd;
use crate::io;
use crate::shm::ShmOFlags;
use crate::shm;

const NAME_MAX: usize = 255;
const SHM_DIR: &[u8] = b"/dev/shm/";
Expand Down Expand Up @@ -32,7 +32,7 @@ fn get_shm_name(name: &CStr) -> io::Result<([u8; NAME_MAX + SHM_DIR.len() + 1],
Ok((path, SHM_DIR.len() + name.len() + 1))
}

pub(crate) fn shm_open(name: &CStr, oflags: ShmOFlags, mode: Mode) -> io::Result<OwnedFd> {
pub(crate) fn shm_open(name: &CStr, oflags: shm::OFlags, mode: Mode) -> io::Result<OwnedFd> {
let (path, len) = get_shm_name(name)?;
open(
CStr::from_bytes_with_nul(&path[..len]).unwrap(),
Expand Down
38 changes: 0 additions & 38 deletions src/backend/linux_raw/thread/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,44 +50,6 @@ pub(crate) enum Operation {
LockPi2 = linux_raw_sys::general::FUTEX_LOCK_PI2,
}

/// `FUTEX_*` operations for use with the [`futex`] function.
///
/// [`futex`]: fn@crate::thread::futex
// TODO: Deprecate this now that we have a new typed API.
/*
#[deprecated(
since = "0.38.35",
note = "
The `futex` function and `FutexOperation` enum are deprecated. There are
individual functions available to perform futex operations with improved
type safety. See the `rustix::thread::futex` module."
)]
*/
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum FutexOperation {
/// `FUTEX_WAIT`
Wait = linux_raw_sys::general::FUTEX_WAIT,
/// `FUTEX_WAKE`
Wake = linux_raw_sys::general::FUTEX_WAKE,
/// `FUTEX_FD`
Fd = linux_raw_sys::general::FUTEX_FD,
/// `FUTEX_REQUEUE`
Requeue = linux_raw_sys::general::FUTEX_REQUEUE,
/// `FUTEX_CMP_REQUEUE`
CmpRequeue = linux_raw_sys::general::FUTEX_CMP_REQUEUE,
/// `FUTEX_WAKE_OP`
WakeOp = linux_raw_sys::general::FUTEX_WAKE_OP,
/// `FUTEX_LOCK_PI`
LockPi = linux_raw_sys::general::FUTEX_LOCK_PI,
/// `FUTEX_UNLOCK_PI`
UnlockPi = linux_raw_sys::general::FUTEX_UNLOCK_PI,
/// `FUTEX_TRYLOCK_PI`
TrylockPi = linux_raw_sys::general::FUTEX_TRYLOCK_PI,
/// `FUTEX_WAIT_BITSET`
WaitBitset = linux_raw_sys::general::FUTEX_WAIT_BITSET,
}

/// `FUTEX_WAITERS`
pub const WAITERS: u32 = linux_raw_sys::general::FUTEX_WAITERS;

Expand Down
10 changes: 0 additions & 10 deletions src/fs/cwd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,3 @@ use backend::fd::{BorrowedFd, RawFd};
#[doc(alias = "AT_FDCWD")]
pub const CWD: BorrowedFd<'static> =
unsafe { BorrowedFd::<'static>::borrow_raw(c::AT_FDCWD as RawFd) };

/// Return the value of [`CWD`].
#[deprecated(note = "Use `CWD` in place of `cwd()`.")]
pub const fn cwd() -> BorrowedFd<'static> {
let at_fdcwd = c::AT_FDCWD as RawFd;

// SAFETY: `AT_FDCWD` is a reserved value that is never dynamically
// allocated, so it'll remain valid for the duration of `'static`.
unsafe { BorrowedFd::<'static>::borrow_raw(at_fdcwd) }
}
10 changes: 0 additions & 10 deletions src/fs/inotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ use crate::io::{read_uninit, Errno};
use core::mem::{align_of, size_of, MaybeUninit};
use linux_raw_sys::general::inotify_event;

#[deprecated(note = "Use `inotify::add_watch`.")]
#[doc(hidden)]
pub use add_watch as inotify_add_watch;
#[deprecated(note = "Use `inotify::init`.")]
#[doc(hidden)]
pub use init as inotify_init;
#[deprecated(note = "Use `inotify::remove_watch`.")]
#[doc(hidden)]
pub use remove_watch as inotify_remove_watch;

/// `inotify_init1(flags)`—Creates a new inotify object.
///
/// Use the [`CreateFlags::CLOEXEC`] flag to prevent the resulting file
Expand Down
6 changes: 0 additions & 6 deletions src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ mod makedev;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
mod memfd_create;
#[cfg(linux_kernel)]
#[cfg(feature = "fs")]
mod mount;
#[cfg(linux_kernel)]
mod openat2;
#[cfg(linux_kernel)]
mod raw_dir;
Expand Down Expand Up @@ -115,9 +112,6 @@ pub use makedev::*;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
pub use memfd_create::memfd_create;
#[cfg(linux_kernel)]
#[cfg(feature = "fs")]
pub use mount::*;
#[cfg(linux_kernel)]
pub use openat2::openat2;
#[cfg(linux_kernel)]
pub use raw_dir::{RawDir, RawDirEntry};
Expand Down
55 changes: 0 additions & 55 deletions src/fs/mount.rs

This file was deleted.

10 changes: 0 additions & 10 deletions src/mount/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
//! Linux `mount` API.

// The `mount` module includes the `mount` function and related
// functions which were originally defined in `rustix::fs` but are
// now replaced by deprecated aliases. After the next semver bump,
// we can remove the aliases and all the `#[cfg(feature = "mount")]`
// here and in src/backend/*/mount.
//
// The `fsopen` module includes `fsopen` and related functions.

#[cfg(feature = "mount")]
mod fsopen;
mod mount_unmount;
mod types;

#[cfg(feature = "mount")]
pub use fsopen::*;
pub use mount_unmount::*;
pub use types::*;
9 changes: 0 additions & 9 deletions src/shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ use crate::{backend, io, path};
use super::shm;
pub use crate::backend::fs::types::Mode;
pub use crate::backend::shm::types::ShmOFlags as OFlags;
#[deprecated(note = "Use `shm::OFlags`.")]
#[doc(hidden)]
pub use crate::backend::shm::types::ShmOFlags;
#[deprecated(note = "Use `shm::open`.")]
#[doc(hidden)]
pub use open as shm_open;
#[deprecated(note = "Use `shm::unlink`.")]
#[doc(hidden)]
pub use unlink as shm_unlink;

/// `shm_open(name, oflags, mode)`—Opens a shared memory object.
///
Expand Down
3 changes: 3 additions & 0 deletions src/termios/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use backend::c;

/// `ioctl(fd, TIOCEXCL)`—Enables exclusive mode on a terminal.
///
/// In exclusive mode, subsequent unpriveleged `open` calls on the terminal
/// device fail with [`io::Errno::BUSY`].
///
/// # References
/// - [Linux]
/// - [FreeBSD]
Expand Down
Loading