@@ -112,7 +112,7 @@ fn rtkit_set_realtime(thread: u64, pid: u64, prio: u32) -> Result<(), Box<dyn Er
112
112
113
113
/// Returns the maximum priority, maximum real-time time slice, and the current real-time time
114
114
/// slice for this process.
115
- fn get_limits ( ) -> Result < ( i64 , u64 , libc:: rlimit64 ) , AudioThreadPriorityError > {
115
+ fn get_limits ( ) -> Result < ( i64 , u64 , libc:: rlimit ) , AudioThreadPriorityError > {
116
116
let c = Connection :: get_private ( BusType :: System ) ?;
117
117
118
118
let p = Props :: new (
@@ -122,7 +122,7 @@ fn get_limits() -> Result<(i64, u64, libc::rlimit64), AudioThreadPriorityError>
122
122
"org.freedesktop.RealtimeKit1" ,
123
123
DBUS_SOCKET_TIMEOUT ,
124
124
) ;
125
- let mut current_limit = libc:: rlimit64 {
125
+ let mut current_limit = libc:: rlimit {
126
126
rlim_cur : 0 ,
127
127
rlim_max : 0 ,
128
128
} ;
@@ -141,9 +141,9 @@ fn get_limits() -> Result<(i64, u64, libc::rlimit64), AudioThreadPriorityError>
141
141
) ) ;
142
142
}
143
143
144
- if unsafe { libc:: getrlimit64 ( libc:: RLIMIT_RTTIME , & mut current_limit) } < 0 {
144
+ if unsafe { libc:: getrlimit ( libc:: RLIMIT_RTTIME , & mut current_limit) } < 0 {
145
145
return Err ( AudioThreadPriorityError :: new_with_inner (
146
- "getrlimit64 " ,
146
+ "getrlimit " ,
147
147
Box :: new ( OSError :: last_os_error ( ) ) ,
148
148
) ) ;
149
149
}
@@ -154,13 +154,13 @@ fn get_limits() -> Result<(i64, u64, libc::rlimit64), AudioThreadPriorityError>
154
154
fn set_limits ( request : u64 , max : u64 ) -> Result < ( ) , AudioThreadPriorityError > {
155
155
// Set a soft limit to the limit requested, to be able to handle going over the limit using
156
156
// SIGXCPU. Set the hard limit to the maxium slice to prevent getting SIGKILL.
157
- let new_limit = libc:: rlimit64 {
157
+ let new_limit = libc:: rlimit {
158
158
rlim_cur : request,
159
159
rlim_max : max,
160
160
} ;
161
- if unsafe { libc:: setrlimit64 ( libc:: RLIMIT_RTTIME , & new_limit) } < 0 {
161
+ if unsafe { libc:: setrlimit ( libc:: RLIMIT_RTTIME , & new_limit) } < 0 {
162
162
return Err ( AudioThreadPriorityError :: new_with_inner (
163
- "setrlimit64 " ,
163
+ "setrlimit " ,
164
164
Box :: new ( OSError :: last_os_error ( ) ) ,
165
165
) ) ;
166
166
}
@@ -297,10 +297,10 @@ pub fn promote_thread_to_real_time_internal(
297
297
Err ( e) => {
298
298
let ( _, _, limits) = get_limits ( ) ?;
299
299
if limits. rlim_cur != libc:: RLIM_INFINITY
300
- && unsafe { libc:: setrlimit64 ( libc:: RLIMIT_RTTIME , & limits) } < 0
300
+ && unsafe { libc:: setrlimit ( libc:: RLIMIT_RTTIME , & limits) } < 0
301
301
{
302
302
return Err ( AudioThreadPriorityError :: new_with_inner (
303
- "setrlimit64 " ,
303
+ "setrlimit " ,
304
304
Box :: new ( OSError :: last_os_error ( ) ) ,
305
305
) ) ;
306
306
}
0 commit comments