4
4
#![ cfg( unix) ]
5
5
6
6
use anyhow:: Context ;
7
- use libc:: { _exit, execve, nfds_t, pid_t , poll, pollfd, EXIT_FAILURE , POLLHUP } ;
7
+ use libc:: { _exit, execve, nfds_t, poll, pollfd, EXIT_FAILURE , POLLHUP } ;
8
8
use nix:: errno:: Errno ;
9
9
use nix:: sys:: wait:: { waitpid, WaitPidFlag , WaitStatus } ;
10
10
use nix:: unistd:: Pid ;
11
- use std:: io:: { self , BufRead , BufReader } ;
12
11
use std:: os:: fd:: IntoRawFd ;
13
12
use std:: time:: { Duration , Instant } ;
14
13
use std:: {
@@ -17,6 +16,9 @@ use std::{
17
16
os:: fd:: RawFd ,
18
17
} ;
19
18
19
+ #[ cfg( target_os = "linux" ) ]
20
+ use std:: io:: { self , BufRead , BufReader } ;
21
+
20
22
// The args_cstrings and env_vars_strings fields are just storage. Even though they're
21
23
// unreferenced, they're a necessary part of the struct.
22
24
#[ allow( dead_code) ]
@@ -201,9 +203,9 @@ fn is_being_traced() -> io::Result<bool> {
201
203
}
202
204
203
205
#[ cfg( target_os = "linux" ) ]
204
- pub fn alt_fork ( ) -> pid_t {
206
+ pub fn alt_fork ( ) -> libc :: pid_t {
205
207
use libc:: {
206
- c_ulong, c_void, syscall, SYS_clone , CLONE_CHILD_CLEARTID , CLONE_CHILD_SETTID ,
208
+ c_ulong, c_void, pid_t , syscall, SYS_clone , CLONE_CHILD_CLEARTID , CLONE_CHILD_SETTID ,
207
209
CLONE_PTRACE , SIGCHLD ,
208
210
} ;
209
211
0 commit comments