From 657c4a9d6c2e649d86307f46ce9d5e44192f6e7a Mon Sep 17 00:00:00 2001 From: Damien Riegel Date: Mon, 27 Feb 2017 12:36:37 -0500 Subject: fcntl.h: fix a missing `struct timespec` definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #endif This bug was spotted during the compilation of BoringSSL against uClibc. Signed-off-by: Damien Riegel --- include/fcntl.h | 3 +++ 1 file changed, 3 insertions(+) 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 should also be available. */ #ifdef __USE_XOPEN +# ifdef __USE_XOPEN2K8 +# define __need_timespec +# endif # include #endif -- cgit v1.2.3