Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec0c755

Browse files
committed
Check that we get somewhat sane PIDs when spawning with pidfds
1 parent3e4e31b commitec0c755

File tree

1 file changed

+3
-0
lines changed
  • library/std/src/sys/pal/unix/linux/pidfd

1 file changed

+3
-0
lines changed

‎library/std/src/sys/pal/unix/linux/pidfd/tests.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fn test_command_pidfd() {
2121
let flags =super::cvt(unsafe{ libc::fcntl(pidfd.as_raw_fd(), libc::F_GETFD)}).unwrap();
2222
assert!(flags& libc::FD_CLOEXEC !=0);
2323
}
24+
assert!(child.id() >0 && child.id() < -1i32asu32);
2425
let status = child.wait().expect("error waiting on pidfd");
2526
assert_eq!(status.code(),Some(1));
2627

@@ -47,6 +48,8 @@ fn test_command_pidfd() {
4748
letmut child =
4849
unsafe{Command::new("false").pre_exec(||Ok(()))}.create_pidfd(true).spawn().unwrap();
4950

51+
assert!(child.id() >0 && child.id() < -1i32asu32);
52+
5053
if pidfd_open_available{
5154
assert!(child.pidfd().is_ok())
5255
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp