Skip to content

Commit b069de6

Browse files
committed
posix: signal.h: always pull in time_t definition from libc
Avoid redefining `time_t` by always including the definition from `<time.h>`, since the C library may use something other than `long`. This is still safe according to the specification, since it explicitly states: > Inclusion of the <signal.h> header may make visible all symbols from > the <time.h> header. For more information, please see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html Signed-off-by: Chris Friedt <[email protected]>
1 parent 9f13274 commit b069de6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

include/zephyr/posix/posix_signal.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ typedef int uid_t;
4343
#define __uid_t_defined
4444
#endif
4545

46-
#if !defined(_TIME_T_DECLARED) && !defined(__time_t_defined)
47-
typedef long time_t;
48-
#define _TIME_T_DECLARED
49-
#define __time_t_defined
50-
#endif
46+
/* time_t must be defined by the libc time.h */
47+
#include <time.h>
5148

5249
#if !defined(_TIMESPEC_DECLARED) && !defined(__timespec_defined)
5350
struct timespec {

0 commit comments

Comments
 (0)