Skip to content

Commit 981c75a

Browse files
committed
posix: time.h: workaround for undefined pid_t in picolibc's time.h
Define pid_t before including Picolibc's time.h, which does not yet include the proper fix in picolibc/picolibc#1079 . Signed-off-by: Chris Friedt <[email protected]>
1 parent c171282 commit 981c75a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

include/zephyr/posix/time.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,20 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#ifndef ZEPHYR_INCLUDE_POSIX_TIME_H_
8+
#define ZEPHYR_INCLUDE_POSIX_TIME_H_
9+
10+
#ifdef CONFIG_PICOLIBC
11+
/* temporary workaround for https://github.com/picolibc/picolibc/pull/1079 */
12+
#include <sys/_types.h>
13+
14+
#ifndef _PID_T_DECLARED
15+
typedef __pid_t pid_t;
16+
#define _PID_T_DECLARED
17+
#endif
18+
#endif
19+
720
/* This header will soon be deprecated. Please include <time.h> instead. */
821
#include_next <time.h>
22+
23+
#endif /* ZEPHYR_INCLUDE_POSIX_TIME_H_ */

0 commit comments

Comments
 (0)