Re: [PATCH 09/12] tools/nolibc: use a custom struct timespec

From: Arnd Bergmann

Date: Thu Oct 30 2025 - 10:46:42 EST


On Wed, Oct 29, 2025, at 17:02, Thomas Weißschuh wrote:
>
> +struct timespec {
> + time_t tv_sec;
> + long tv_nsec;
> +};
> +#define _STRUCT_TIMESPEC
> +
> +#include <linux/time.h>

Unfortunately this is not the definition we want on big-endian
systems because it puts the tv_nsec field in the wrong place.

You can either uses the simple (non-POSIX) __kernel_timespec
definition in nolibc with a 64-bit tv_nsec, or copy the more
complicated definition with explicit padding that is used
in musl and glibc.

Arnd