@@ -188,16 +188,19 @@ type Word = usize;
188
188
/// Makes the `PTRACE_SYSCALL` request to ptrace
189
189
pub fn syscall ( pid : Pid ) -> Result < ( ) > {
190
190
unsafe {
191
- ptrace ( ptrace:: PTRACE_SYSCALL , pid, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) . map ( |_| ( ) ) // ignore the useless return value
191
+ ptrace (
192
+ ptrace:: PTRACE_SYSCALL ,
193
+ pid,
194
+ ptr:: null_mut ( ) ,
195
+ ptr:: null_mut ( ) ,
196
+ ) . map ( |_| ( ) ) // ignore the useless return value
192
197
}
193
198
}
194
199
195
200
/// Makes the `PTRACE_PEEKUSER` request to ptrace
196
201
pub fn peekuser ( pid : Pid , reg : Register ) -> Result < Word > {
197
202
let reg_arg = ( reg as i32 ) as * mut c_void ;
198
- unsafe {
199
- ptrace ( ptrace:: PTRACE_PEEKUSER , pid, reg_arg, ptr:: null_mut ( ) ) . map ( |r| r as Word )
200
- }
203
+ unsafe { ptrace ( ptrace:: PTRACE_PEEKUSER , pid, reg_arg, ptr:: null_mut ( ) ) . map ( |r| r as Word ) }
201
204
}
202
205
203
206
/// Makes the `PTRACE_POKEUSER` request to ptrace
@@ -228,7 +231,12 @@ pub fn traceme() -> Result<()> {
228
231
/// This function allows to access arbitrary data in the traced process
229
232
/// and may crash the inferior if used incorrectly and is thus marked `unsafe`.
230
233
pub unsafe fn peekdata ( pid : Pid , addr : usize ) -> Result < Word > {
231
- ptrace ( ptrace:: PTRACE_PEEKDATA , pid, addr as * mut c_void , ptr:: null_mut ( ) ) . map ( |r| r as Word )
234
+ ptrace (
235
+ ptrace:: PTRACE_PEEKDATA ,
236
+ pid,
237
+ addr as * mut c_void ,
238
+ ptr:: null_mut ( ) ,
239
+ ) . map ( |r| r as Word )
232
240
}
233
241
234
242
/// Makes the `PTRACE_POKEDATA` request to ptrace
0 commit comments