From d4d9d0a3334da5e7da6e873ae9820af75ecba8b5 Mon Sep 17 00:00:00 2001 From: Fedor Lapshin Date: Mon, 4 Mar 2024 23:55:11 +0300 Subject: [PATCH] options/ansi: add a comment about layout of timespec --- options/ansi/include/bits/ansi/timespec.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/options/ansi/include/bits/ansi/timespec.h b/options/ansi/include/bits/ansi/timespec.h index 70d06eebe1..926d8e7f3c 100644 --- a/options/ansi/include/bits/ansi/timespec.h +++ b/options/ansi/include/bits/ansi/timespec.h @@ -5,8 +5,13 @@ #include #include +// Equivalent of timespec64 in glibc. +// Should be used only with 64-bit syscalls +// or with appropriate compat syscalls. struct timespec { time_t tv_sec; + // tv_nspec is required to be long by the C standard. + // However linux kernel expects long long. So we add padding. __MLIBC_FIELD_PADDED(long, tv_nsec, long long); };