Commit 962e42cf authored by Keith Packard's avatar Keith Packard Committed by Carles Cufi
Browse files

tests, samples: Define _POSIX_C_SOURCE where needed



Various tests and samples use POSIX-only functions. Define _POSIX_C_SOURCE
to ensure they are visible.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent 6e1210a0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+0 −2
Original line number Diff line number Diff line
@@ -15,10 +15,8 @@
 * it guarantee that ALL functionality provided is working correctly.
 */

#if defined(CONFIG_NATIVE_LIBC)
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif

#include <zephyr/kernel.h>
#include <zephyr/sys/__assert.h>
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include <stdio.h>
#include <fcntl.h>
#include <zephyr/posix/unistd.h>
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include <string.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/unistd.h>