[PATCH] time: Define _STRUCT_TIMESPEC in <bits/types/struct_timespec.h>

Florian Weimer fweimer@redhat.com
Thu Jun 21 06:47:00 GMT 2018


After commit d76d3703551a362b472c866b5b6089f66f8daa8e ("Fix missing
timespec definition for sys/stat.h (BZ #21371)"), sanitizer builds start
to fail due to a conflicting definition of struct timespec in
<linux/time.h>.  Define _STRUCT_TIMESPEC, which is already checked in
the kernel header, to support including <linux/time.h> after
<sys/stat.h>.

2018-06-21  Florian Weimer  <fweimer@redhat.com>

	* time/bits/types/struct_timespec.h (_STRUCT_TIMESPEC): Define.

diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
index 644db9fdb6..bde7e2826d 100644
--- a/time/bits/types/struct_timespec.h
+++ b/time/bits/types/struct_timespec.h
@@ -1,6 +1,10 @@
 #ifndef __timespec_defined
 #define __timespec_defined 1
 
+#ifndef _STRUCT_TIMESPEC
+# define _STRUCT_TIMESPEC 1
+#endif
+
 #include <bits/types.h>
 
 /* POSIX.1b structure for a time value.  This is like a `struct timeval' but



More information about the Libc-alpha mailing list