summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Riegel <damien.riegel@savoirfairelinux.com>2017-02-27 12:36:37 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2017-02-28 19:23:40 +0100
commit657c4a9d6c2e649d86307f46ce9d5e44192f6e7a (patch)
treeaa43afb4afcb88dd15724355726c473d20d4820a
parent058c263f6bd41ffa18328e0ff60d25d3a028f975 (diff)
fcntl.h: fix a missing `struct timespec` definition
If a source file is compiled with: #define _XOPEN_SOURCE 700 #define _POSIX_C_SOURCE 200112L Then including fcntl.h results in the following error: In file included from fcntl.h:37:0, from test.c:4: sys/stat.h:371:54: error: array type has incomplete element type ‘struct timespec’ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; To fix that, we force the definition of struct timespec in fcntl.h when __USE_XOPEN2K8 is defined. This mimics the behavior of glibc which contains the following line in its io/fcntl.h header (included by fcntlh.h): #ifdef __USE_XOPEN2K8 # include <bits/types/struct_timespec.h> #endif This bug was spotted during the compilation of BoringSSL against uClibc. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
-rw-r--r--include/fcntl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fcntl.h b/include/fcntl.h
index adcd7ef4b..5a73a9862 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -34,6 +34,9 @@ __BEGIN_DECLS
/* For XPG all symbols from <sys/stat.h> should also be available. */
#ifdef __USE_XOPEN
+# ifdef __USE_XOPEN2K8
+# define __need_timespec
+# endif
# include <sys/stat.h>
#endif