File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ mod parser;
18
18
mod reader;
19
19
mod redirection;
20
20
mod screen;
21
+ mod std;
21
22
mod string_escape;
22
23
mod threads;
23
24
mod tokenizer;
Original file line number Diff line number Diff line change
1
+ //! This module contains tests that assert the functionality and behavior of the rust standard
2
+ //! library, to ensure we can safely use its abstractions to perform low-level operations.
3
+
4
+ use std:: fs:: File ;
5
+ use std:: os:: fd:: AsRawFd ;
6
+
7
+ #[ test]
8
+ fn test_fd_cloexec ( ) {
9
+ // Just open a file. Any file.
10
+ let file = File :: create ( "test_file_for_fd_cloexec" ) . unwrap ( ) ;
11
+ let fd = file. as_raw_fd ( ) ;
12
+ unsafe {
13
+ assert_eq ! ( libc:: fcntl( fd, libc:: F_GETFD ) & libc:: FD_CLOEXEC , libc:: FD_CLOEXEC ) ;
14
+ }
15
+ let _ = std:: fs:: remove_file ( "test_file_for_fd_cloexec" ) ;
16
+ }
You can’t perform that action at this time.
0 commit comments