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 ,
@@ -6129,6 +6131,28 @@ extern "C" {
6129
6131
pub fn ioctl ( fd : :: c_int , request : :: Ioctl , ...) -> :: c_int ;
6130
6132
}
6131
6133
6134
+ cfg_if ! {
6135
+ if #[ cfg( target_env = "musl" ) ] {
6136
+ extern "C" {
6137
+ pub fn getitimer( which: :: c_int, value: * mut :: itimerval) -> :: c_int;
6138
+ pub fn setitimer(
6139
+ which: :: c_int,
6140
+ new: * const :: itimerval,
6141
+ old: * mut :: itimerval,
6142
+ ) -> :: c_int;
6143
+ }
6144
+ } else {
6145
+ extern "C" {
6146
+ pub fn getitimer( which: :: __itimer_which_t, value: * mut :: itimerval) -> :: c_int;
6147
+ pub fn setitimer(
6148
+ which: :: __itimer_which_t,
6149
+ new: * const :: itimerval,
6150
+ old: * mut :: itimerval,
6151
+ ) -> :: c_int;
6152
+ }
6153
+ }
6154
+ }
6155
+
6132
6156
// LFS64 extensions
6133
6157
//
6134
6158
// * 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