@@ -78,6 +78,12 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
78
78
}
79
79
}
80
80
81
+ // TODO implement functionality
82
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
83
+ pub fn get_uptime ( _boot_time : Option < time_t > ) ->UResult < i64 > {
84
+ Err ( UptimeError :: SystemUptime ) ?
85
+ }
86
+
81
87
/// Get the system uptime
82
88
///
83
89
/// # Arguments
@@ -88,7 +94,7 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
88
94
///
89
95
/// Returns a UResult with the uptime in seconds if successful, otherwise an UptimeError.
90
96
#[ cfg( unix) ]
91
- #[ cfg( not( target_os ="openbsd" ) ) ]
97
+ #[ cfg( not( any ( target_os ="openbsd" , target_os = "android" , target_os = "redox" ) ) ) ]
92
98
pub fn get_uptime ( boot_time : Option < time_t > ) ->UResult < i64 > {
93
99
use crate :: utmpx:: Utmpx ;
94
100
use libc:: BOOT_TIME ;
@@ -187,7 +193,7 @@ pub fn get_formatted_uptime(boot_time: Option<time_t>) -> UResult<String> {
187
193
///
188
194
/// Returns the number of users currently logged in if successful, otherwise 0.
189
195
#[ cfg( unix) ]
190
- #[ cfg( not( target_os ="openbsd" ) ) ]
196
+ #[ cfg( not( any ( target_os ="openbsd" , target_os = "android" , target_os = "redox" ) ) ) ]
191
197
// see: https://gitlab.com/procps-ng/procps/-/blob/4740a0efa79cade867cfc7b32955fe0f75bf5173/library/uptime.c#L63-L115
192
198
pub fn get_nusers ( ) ->usize {
193
199
use crate :: utmpx:: Utmpx ;
@@ -234,6 +240,12 @@ pub fn get_nusers(file: &str) -> usize {
234
240
nusers
235
241
}
236
242
243
+ // TODO implement functionality
244
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
245
+ pub fn get_nusers ( ) ->usize {
246
+ 0
247
+ }
248
+
237
249
/// Get the number of users currently logged in
238
250
///
239
251
/// # Returns
@@ -333,6 +345,7 @@ pub fn get_formatted_nusers() -> String {
333
345
/// Returns a UResult with the load average if successful, otherwise an UptimeError.
334
346
/// The load average is a tuple of three floating point numbers representing the 1-minute, 5-minute, and 15-minute load averages.
335
347
#[ cfg( unix) ]
348
+ #[ cfg( not( any( target_os ="android" , target_os ="redox" ) ) ) ]
336
349
pub fn get_loadavg ( ) ->UResult < ( f64 , f64 , f64 ) > {
337
350
use crate :: libc:: c_double;
338
351
use libc:: getloadavg;
@@ -348,6 +361,12 @@ pub fn get_loadavg() -> UResult<(f64, f64, f64)> {
348
361
}
349
362
}
350
363
364
+ // TODO implement functionality
365
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
366
+ pub fn get_loadavg ( ) ->UResult < ( f64 , f64 , f64 ) > {
367
+ Err ( UptimeError :: SystemLoadavg ) ?
368
+ }
369
+
351
370
/// Get the system load average
352
371
/// Windows does not have an equivalent to the load average on Unix-like systems.
353
372
///