Displaying 2 results from an estimated 2 matches for "__tv_pad".
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
...rn.h>
> +#include <klibc/endian.h>
> #include <stddef.h>
> #include <sys/types.h>
> -#include <linux/time.h>
> +
> +struct timespec {
> + __kernel_time64_t tv_sec;
> +#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> + long tv_nsec;
> +#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> +};
The problem with this definition is applications doing things like
struct timespec ts = { 0, 5000 }; /* 5 ?s */
which on big-endian archit...
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
...define _SYS_TIME_H
#include <klibc/extern.h>
+#include <klibc/endian.h>
#include <stddef.h>
#include <sys/types.h>
-#include <linux/time.h>
+
+struct timespec {
+ __kernel_time64_t tv_sec;
+#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32
+ long __tv_pad;
+#endif
+ long tv_nsec;
+#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32
+ long __tv_pad;
+#endif
+};
+
+struct timeval {
+ __kernel_time64_t tv_sec;
+ __kernel_suseconds_t tv_usec;
+};
+
+struct timeval_old {
+ __kernel_time_t tv_sec;
+ __kernel_suseconds_t tv_usec;
+};...