File tree 3 files changed +30
-0
lines changed
src/unix/linux_like/linux
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3558,6 +3558,9 @@ fn test_linux(target: &str) {
3558
3558
// https://github.com/rust-lang/libc/issues/1359
3559
3559
"sighandler_t" => true ,
3560
3560
3561
+ // musl doesn't define these; instead, it uses a raw int for getitimer/setitimer
3562
+ "__itimer_which_t" if musl => true ,
3563
+
3561
3564
// These cannot be tested when "resolv.h" is included and are tested
3562
3565
// in the `linux_elf.rs` file.
3563
3566
"Elf64_Phdr" | "Elf32_Phdr" => true ,
Original file line number Diff line number Diff line change @@ -3475,6 +3475,7 @@ __c_anonymous_sockaddr_can_j1939
3475
3475
__c_anonymous_sockaddr_can_tp
3476
3476
__errno_location
3477
3477
__exit_status
3478
+ __itimer_which_t
3478
3479
__s16
3479
3480
__s32
3480
3481
__u16
@@ -3591,6 +3592,7 @@ getgrnam_r
3591
3592
getgrouplist
3592
3593
gethostid
3593
3594
getifaddrs
3595
+ getitimer
3594
3596
getline
3595
3597
getmntent
3596
3598
getnameinfo
@@ -3892,6 +3894,7 @@ setfsuid
3892
3894
setgrent
3893
3895
setgroups
3894
3896
sethostname
3897
+ setitimer
3895
3898
setmntent
3896
3899
setns
3897
3900
setpriority
Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ missing! {
73
73
pub enum fpos64_t { } // FIXME: fill this out with a struct
74
74
}
75
75
76
+ pub type __itimer_which_t = :: c_int ;
77
+
76
78
e ! {
77
79
pub enum tpacket_versions {
78
80
TPACKET_V1 ,
@@ -6113,6 +6115,28 @@ extern "C" {
6113
6115
pub fn ioctl ( fd : :: c_int , request : :: Ioctl , ...) -> :: c_int ;
6114
6116
}
6115
6117
6118
+ cfg_if ! {
6119
+ if #[ cfg( target_env = "musl" ) ] {
6120
+ extern "C" {
6121
+ pub fn getitimer( which: :: c_int, value: * mut :: itimerval) -> :: c_int;
6122
+ pub fn setitimer(
6123
+ which: :: c_int,
6124
+ new: * const :: itimerval,
6125
+ old: * mut :: itimerval,
6126
+ ) -> :: c_int;
6127
+ }
6128
+ } else {
6129
+ extern "C" {
6130
+ pub fn getitimer( which: :: __itimer_which_t, value: * mut :: itimerval) -> :: c_int;
6131
+ pub fn setitimer(
6132
+ which: :: __itimer_which_t,
6133
+ new: * const :: itimerval,
6134
+ old: * mut :: itimerval,
6135
+ ) -> :: c_int;
6136
+ }
6137
+ }
6138
+ }
6139
+
6116
6140
// LFS64 extensions
6117
6141
//
6118
6142
// * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones
You can’t perform that action at this time.
0 commit comments