Skip to content

Commit 56d0cea

Browse files
committed
posix: Ensure POSIX API subfeatures are not built with host libC
As it is possible to select some of these features without selecting the whole CONFIG_POSIX_API let's ensure we set NATIVE_LIBC_INCOMPATIBLE for them so when we build for native simulator based targets, we also use one of the embedded C libraries. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 0a339a2 commit 56d0cea

20 files changed

+24
-0
lines changed

lib/posix/options/Kconfig.aio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
config POSIX_ASYNCHRONOUS_IO
66
bool "POSIX asynchronous I/O"
7+
select NATIVE_LIBC_INCOMPATIBLE
78
help
89
Enable this option for asynchronous I/O. This option is present for conformance purposes
910
only. All functions listed in <aio.h> return -1 and set errno to ENOSYS.

lib/posix/options/Kconfig.barrier

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
menuconfig POSIX_BARRIERS
88
bool "POSIX barriers"
9+
select NATIVE_LIBC_INCOMPATIBLE
910
help
1011
Select 'y' here to enable POSIX barriers.
1112

lib/posix/options/Kconfig.c_lib_ext

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
menuconfig POSIX_C_LIB_EXT
66
bool "POSIX general C library extension"
7+
select NATIVE_LIBC_INCOMPATIBLE
78
help
89
Select 'y' here and Zephyr will provide an implementation of the POSIX_C_LIB_EXT Option
910
Group, consisting of fnmatch(), getopt(), getsubopt(), optarg, opterr, optind, optopt,

lib/posix/options/Kconfig.device_io

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config POSIX_DEVICE_IO
1010
select ZVFS
1111
select ZVFS_POLL
1212
select ZVFS_SELECT
13+
select NATIVE_LIBC_INCOMPATIBLE
1314
help
1415
Select 'y' here and Zephyr will provide an implementation of the POSIX_DEVICE_IO Option
1516
Group such as FD_CLR(), FD_ISSET(), FD_SET(), FD_ZERO(), close(), fdopen(), fileno(), open(),

lib/posix/options/Kconfig.fd_mgmt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
menuconfig POSIX_FD_MGMT
66
bool "POSIX file descriptor management"
7+
select NATIVE_LIBC_INCOMPATIBLE
78
help
89
Select 'y' here and Zephyr will provide implementations for the POSIX_FD_MGMT Option Group.
910
This includes support for dup(), dup2(), fcntl(), fseeko(), ftello(), ftruncate(),

lib/posix/options/Kconfig.file_system_r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config POSIX_FILE_SYSTEM_R
66
bool "Thread-Safe File System"
77
select FILE_SYSTEM
88
select FDTABLE
9+
select NATIVE_LIBC_INCOMPATIBLE
910
help
1011
Select 'y' here and Zephyr will provide an implementation of the POSIX_FILE_SYSTEM_R
1112
Option Group, consisting of readdir_r().

lib/posix/options/Kconfig.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ menuconfig POSIX_FILE_SYSTEM
77
default y if POSIX_API
88
select FILE_SYSTEM
99
select FDTABLE
10+
select NATIVE_LIBC_INCOMPATIBLE
1011
help
1112
This enables POSIX style file system related APIs.
1213

lib/posix/options/Kconfig.mem

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config POSIX_SHARED_MEMORY_OBJECTS
1818
select SYS_HASH_FUNC32_DJB2
1919
select FDTABLE
2020
select POSIX_MAPPED_FILES
21+
select NATIVE_LIBC_INCOMPATIBLE
2122
help
2223
Select 'y' here and Zephyr will provide implementations of shm_open() and shm_unlink().
2324

@@ -27,6 +28,7 @@ config POSIX_SHARED_MEMORY_OBJECTS
2728

2829
config POSIX_MAPPED_FILES
2930
bool "POSIX memory-mapped files"
31+
select NATIVE_LIBC_INCOMPATIBLE
3032
help
3133
Select 'y' here and Zephyr will provide support for mmap(), msync(), and munmap().
3234

@@ -41,6 +43,7 @@ if POSIX_MAPPED_FILES
4143

4244
config POSIX_MEMLOCK
4345
bool "POSIX memory locking"
46+
select NATIVE_LIBC_INCOMPATIBLE
4447
help
4548
Select 'y' here and Zephyr will provide support for mlockall() and munlockall().
4649

@@ -55,6 +58,7 @@ config POSIX_MEMLOCK
5558
config POSIX_MEMLOCK_RANGE
5659
bool "POSIX range memory locking"
5760
imply DEMAND_PAGING
61+
select NATIVE_LIBC_INCOMPATIBLE
5862
help
5963
Select 'y' here and Zephyr will provide support for mlock() and munlock().
6064

@@ -69,6 +73,7 @@ endif
6973

7074
config POSIX_MEMORY_PROTECTION
7175
bool "POSIX memory protection"
76+
select NATIVE_LIBC_INCOMPATIBLE
7277
help
7378
Select 'y' here and Zephyr will provide support for mprotect().
7479

lib/posix/options/Kconfig.mqueue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
menuconfig POSIX_MESSAGE_PASSING
66
bool "POSIX message queue support"
7+
select NATIVE_LIBC_INCOMPATIBLE
78
help
89
This enabled POSIX message queue related APIs.
910

lib/posix/options/Kconfig.net

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ menuconfig POSIX_NETWORKING
1010
select NET_INTERFACE_NAME
1111
select NET_SOCKETPAIR
1212
select NET_SOCKETS
13+
select NATIVE_LIBC_INCOMPATIBLE
1314
help
1415
Enable this option to support the POSIX networking API. This includes
1516
support for BSD Sockets.

0 commit comments

Comments
 (0)