@@ -9,10 +9,12 @@ use sys::signal::Signal;
9
9
10
10
pub type AddressType = * mut :: libc:: c_void ;
11
11
12
- #[ cfg( all( target_os = "linux" ,
13
- any( target_arch = "x86_64" ,
14
- target_arch = "x86" ) ,
15
- target_env = "gnu" ) ) ]
12
+ #[ cfg( all(
13
+ target_os = "linux" ,
14
+ any( all( target_arch = "x86_64" ,
15
+ any( target_env = "gnu" , target_env = "musl" ) ) ,
16
+ all( target_arch = "x86" , target_env = "gnu" ) )
17
+ ) ) ]
16
18
use libc:: user_regs_struct;
17
19
18
20
cfg_if ! {
@@ -199,19 +201,23 @@ fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void)
199
201
}
200
202
201
203
/// Get user registers, as with `ptrace(PTRACE_GETREGS, ...)`
202
- #[ cfg( all( target_os = "linux" ,
203
- any( target_arch = "x86_64" ,
204
- target_arch = "x86" ) ,
205
- target_env = "gnu" ) ) ]
204
+ #[ cfg( all(
205
+ target_os = "linux" ,
206
+ any( all( target_arch = "x86_64" ,
207
+ any( target_env = "gnu" , target_env = "musl" ) ) ,
208
+ all( target_arch = "x86" , target_env = "gnu" ) )
209
+ ) ) ]
206
210
pub fn getregs ( pid : Pid ) -> Result < user_regs_struct > {
207
211
ptrace_get_data :: < user_regs_struct > ( Request :: PTRACE_GETREGS , pid)
208
212
}
209
213
210
214
/// Set user registers, as with `ptrace(PTRACE_SETREGS, ...)`
211
- #[ cfg( all( target_os = "linux" ,
212
- any( target_arch = "x86_64" ,
213
- target_arch = "x86" ) ,
214
- target_env = "gnu" ) ) ]
215
+ #[ cfg( all(
216
+ target_os = "linux" ,
217
+ any( all( target_arch = "x86_64" ,
218
+ any( target_env = "gnu" , target_env = "musl" ) ) ,
219
+ all( target_arch = "x86" , target_env = "gnu" ) )
220
+ ) ) ]
215
221
pub fn setregs ( pid : Pid , regs : user_regs_struct ) -> Result < ( ) > {
216
222
let res = unsafe {
217
223
libc:: ptrace ( Request :: PTRACE_SETREGS as RequestType ,
0 commit comments