@@ -80,6 +80,12 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
80
80
}
81
81
}
82
82
83
+ // TODO implement functionality
84
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
85
+ pub fn get_uptime ( _boot_time : Option < time_t > ) ->UResult < i64 > {
86
+ Err ( UptimeError :: SystemUptime ) ?
87
+ }
88
+
83
89
/// Get the system uptime
84
90
///
85
91
/// # Arguments
@@ -90,7 +96,7 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
90
96
///
91
97
/// Returns a UResult with the uptime in seconds if successful, otherwise an UptimeError.
92
98
#[ cfg( unix) ]
93
- #[ cfg( not( target_os ="openbsd" ) ) ]
99
+ #[ cfg( not( any ( target_os ="openbsd" , target_os = "android" , target_os = "redox" ) ) ) ]
94
100
pub fn get_uptime ( boot_time : Option < time_t > ) ->UResult < i64 > {
95
101
use crate :: utmpx:: Utmpx ;
96
102
use libc:: BOOT_TIME ;
@@ -192,7 +198,7 @@ pub fn get_formatted_uptime(boot_time: Option<time_t>) -> UResult<String> {
192
198
///
193
199
/// Returns the number of users currently logged in if successful, otherwise 0.
194
200
#[ cfg( unix) ]
195
- #[ cfg( not( target_os ="openbsd" ) ) ]
201
+ #[ cfg( not( any ( target_os ="openbsd" , target_os = "android" , target_os = "redox" ) ) ) ]
196
202
// see: https://gitlab.com/procps-ng/procps/-/blob/4740a0efa79cade867cfc7b32955fe0f75bf5173/library/uptime.c#L63-L115
197
203
pub fn get_nusers ( ) ->usize {
198
204
use crate :: utmpx:: Utmpx ;
@@ -239,6 +245,12 @@ pub fn get_nusers(file: &str) -> usize {
239
245
nusers
240
246
}
241
247
248
+ // TODO implement functionality
249
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
250
+ pub fn get_nusers ( ) ->usize {
251
+ 0
252
+ }
253
+
242
254
/// Get the number of users currently logged in
243
255
///
244
256
/// # Returns
@@ -337,6 +349,7 @@ pub fn get_formatted_nusers() -> String {
337
349
/// Returns a UResult with the load average if successful, otherwise an UptimeError.
338
350
/// The load average is a tuple of three floating point numbers representing the 1-minute, 5-minute, and 15-minute load averages.
339
351
#[ cfg( unix) ]
352
+ #[ cfg( not( any( target_os ="android" , target_os ="redox" ) ) ) ]
340
353
pub fn get_loadavg ( ) ->UResult < ( f64 , f64 , f64 ) > {
341
354
use crate :: libc:: c_double;
342
355
use libc:: getloadavg;
@@ -352,6 +365,12 @@ pub fn get_loadavg() -> UResult<(f64, f64, f64)> {
352
365
}
353
366
}
354
367
368
+ // TODO implement functionality
369
+ #[ cfg( any( target_os ="android" , target_os ="redox" ) ) ]
370
+ pub fn get_loadavg ( ) ->UResult < ( f64 , f64 , f64 ) > {
371
+ Err ( UptimeError :: SystemLoadavg ) ?
372
+ }
373
+
355
374
/// Get the system load average
356
375
/// Windows does not have an equivalent to the load average on Unix-like systems.
357
376
///