@@ -41,7 +41,7 @@ fn test_wait_exit() {
41
41
// FIXME: qemu-user doesn't implement ptrace on most arches
42
42
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
43
43
mod ptrace {
44
- use nix:: sys:: ptrace:: * ;
44
+ use nix:: sys:: ptrace;
45
45
use nix:: sys:: ptrace:: ptrace:: * ;
46
46
use nix:: sys:: signal:: * ;
47
47
use nix:: sys:: wait:: * ;
@@ -51,7 +51,8 @@ mod ptrace {
51
51
use libc:: _exit;
52
52
53
53
fn ptrace_child ( ) -> ! {
54
- let _ = ptrace ( PTRACE_TRACEME , Pid :: from_raw ( 0 ) , ptr:: null_mut ( ) , ptr:: null_mut ( ) ) ;
54
+ // TODO ptrace::traceme will be added in #666
55
+ let _ = ptrace:: ptrace ( PTRACE_TRACEME , Pid :: from_raw ( 0 ) , ptr:: null_mut ( ) , ptr:: null_mut ( ) ) ;
55
56
// As recommended by ptrace(2), raise SIGTRAP to pause the child
56
57
// until the parent is ready to continue
57
58
let _ = raise ( SIGTRAP ) ;
@@ -62,16 +63,18 @@ mod ptrace {
62
63
// Wait for the raised SIGTRAP
63
64
assert_eq ! ( waitpid( child, None ) , Ok ( WaitStatus :: Stopped ( child, SIGTRAP ) ) ) ;
64
65
// We want to test a syscall stop and a PTRACE_EVENT stop
65
- assert ! ( ptrace_setoptions ( child, PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXIT ) . is_ok( ) ) ;
66
+ assert ! ( ptrace :: setoptions ( child, PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXIT ) . is_ok( ) ) ;
66
67
67
68
// First, stop on the next system call, which will be exit()
68
- assert ! ( ptrace( PTRACE_SYSCALL , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
69
+ // TODO ptrace::syscall will be added in #666
70
+ assert ! ( ptrace:: ptrace( PTRACE_SYSCALL , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
69
71
assert_eq ! ( waitpid( child, None ) , Ok ( WaitStatus :: PtraceSyscall ( child) ) ) ;
70
72
// Then get the ptrace event for the process exiting
71
- assert ! ( ptrace( PTRACE_CONT , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
73
+ // TODO ptrace::cont will be added in #666
74
+ assert ! ( ptrace:: ptrace( PTRACE_CONT , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
72
75
assert_eq ! ( waitpid( child, None ) , Ok ( WaitStatus :: PtraceEvent ( child, SIGTRAP , PTRACE_EVENT_EXIT ) ) ) ;
73
76
// Finally get the normal wait() result, now that the process has exited
74
- assert ! ( ptrace( PTRACE_CONT , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
77
+ assert ! ( ptrace:: ptrace ( PTRACE_CONT , child, ptr:: null_mut( ) , ptr:: null_mut( ) ) . is_ok( ) ) ;
75
78
assert_eq ! ( waitpid( child, None ) , Ok ( WaitStatus :: Exited ( child, 0 ) ) ) ;
76
79
}
77
80
0 commit comments