Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit ad0d303

Browse files
add #![feature(linux_pidfd)] and cfg the nightly features correctly
1 parent 2d6a982 commit ad0d303

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ categories = ["api-bindings", "external-ffi-bindings", "os::linux-apis"]
1414
[target.'cfg(target_os = "linux")'.dependencies]
1515
libc = "0.2.98"
1616
pidfd = "0.2.4"
17+
18+
[features]
19+
default = []
20+
nightly = []

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(feature = "nightly", feature(linux_pidfd))]
12
#![deny(unsafe_op_in_unsafe_fn)]
23

34
#[cfg(target_os = "linux")]

src/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
os::unix::prelude::{AsRawFd, FromRawFd, RawFd},
88
};
99

10-
#[cfg(nightly)]
10+
#[cfg(feature = "nightly")]
1111
use std::os::linux::process::PidFd as StdPidFd;
1212

1313
/// Various flags used to configure calls to [`get_file_from_pidfd`].
@@ -38,7 +38,7 @@ impl PidFdExt for PidFd {
3838
}
3939
}
4040

41-
#[cfg(nightly)]
41+
#[cfg(feature = "nightly")]
4242
impl PidFdExt for StdPidFd {
4343
fn get_file(&self, target_fd: RawFd, flags: GetfdFlags) -> IoResult<File> {
4444
get_file_from_pidfd(self.as_raw_fd(), target_fd, flags)

0 commit comments

Comments
 (0)