diff --git a/include/sys/types_internal.h b/include/sys/types_internal.h index 91ec5dbbe0..bcb3c1be0c 100644 --- a/include/sys/types_internal.h +++ b/include/sys/types_internal.h @@ -16,7 +16,11 @@ typedef unsigned id_t; typedef long ssize_t; typedef long long time_t; typedef unsigned int useconds_t; +#if defined(__linux__) +typedef long suseconds_t; +#else typedef int suseconds_t; +#endif typedef long clock_t; typedef int clockid_t; typedef void* timer_t; diff --git a/src/platform/types.rs b/src/platform/types.rs index c400cb6e80..3d14bb29a1 100644 --- a/src/platform/types.rs +++ b/src/platform/types.rs @@ -124,6 +124,12 @@ pub type fsfilcnt_t = c_ulong; #[deprecated] pub type useconds_t = c_uint; /// The `suseconds_t` type provided in [`sys/types.h`](crate::header::sys_types). +#[cfg(target_os = "linux")] +pub type suseconds_t = c_long; +// TODO: Should we break this to c_long as well? This also breaks timeval as well +// but it will be consistent with timespec.tv_nsec (note that syscall already uses c_int) +/// The `suseconds_t` type provided in [`sys/types.h`](crate::header::sys_types). +#[cfg(not(target_os = "linux"))] pub type suseconds_t = c_int; /// The `clock_t` type provided in [`sys/types.h`](crate::header::sys_types).