Skip to content

Commit b4f1749

Browse files
committed
Rename the public ptrace_* functions.
Unlike in C, we have namespacing in Rust. Renaming the functions allows us to avoid a `use nix::sys::ptrace::*` in favor of `use nix::sys::ptrace` and then calling, for example, `ptrace::traceme()`
1 parent 07e6c2f commit b4f1749

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sys/ptrace.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn ptrace_other(request: ptrace::PtraceRequest, pid: Pid, addr: *mut c_void, dat
108108
}
109109

110110
/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`.
111-
pub fn ptrace_setoptions(pid: Pid, options: ptrace::PtraceOptions) -> Result<()> {
111+
pub fn setoptions(pid: Pid, options: ptrace::PtraceOptions) -> Result<()> {
112112
use self::ptrace::*;
113113
use std::ptr;
114114

@@ -117,19 +117,19 @@ pub fn ptrace_setoptions(pid: Pid, options: ptrace::PtraceOptions) -> Result<()>
117117
}
118118

119119
/// Gets a ptrace event as described by `ptrace(PTRACE_GETEVENTMSG,...)`
120-
pub fn ptrace_getevent(pid: Pid) -> Result<c_long> {
120+
pub fn getevent(pid: Pid) -> Result<c_long> {
121121
use self::ptrace::*;
122122
ptrace_get_data::<c_long>(PTRACE_GETEVENTMSG, pid)
123123
}
124124

125125
/// Get siginfo as with `ptrace(PTRACE_GETSIGINFO,...)`
126-
pub fn ptrace_getsiginfo(pid: Pid) -> Result<siginfo_t> {
126+
pub fn getsiginfo(pid: Pid) -> Result<siginfo_t> {
127127
use self::ptrace::*;
128128
ptrace_get_data::<siginfo_t>(PTRACE_GETSIGINFO, pid)
129129
}
130130

131131
/// Set siginfo as with `ptrace(PTRACE_SETSIGINFO,...)`
132-
pub fn ptrace_setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> {
132+
pub fn setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> {
133133
use self::ptrace::*;
134134
let ret = unsafe{
135135
Errno::clear();

0 commit comments

Comments
 (0)