Skip to content

Commit

Permalink
Mark ptrace_peek as unsafe.
Browse files Browse the repository at this point in the history
It can easily introduce data races, hence is, by the Rust definition,
unsafe
  • Loading branch information
marmistrz committed Sep 18, 2017
1 parent 9f4db8a commit 0fff824
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ pub unsafe fn ptrace(request: Request, pid: Pid, addr: *mut c_void, data: *mut c
}
}

fn ptrace_peek(request: Request, pid: Pid, addr: *mut c_void, data: *mut c_void) -> Result<c_long> {
let ret = unsafe {
unsafe fn ptrace_peek(request: Request, pid: Pid, addr: *mut c_void, data: *mut c_void) -> Result<c_long> {
let ret = {
Errno::clear();
libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)
};
Expand Down

0 comments on commit 0fff824

Please sign in to comment.