Browse Source
The functions fnmatch(), getopt(), getentropy() and others are grouped into the standard Option Group POSIX_C_LIB_EXT. The getentropy() function is currently in-draft for Issue 8 as of 2021. https://www.opengroup.org/austin/docs/austin_1110.pdf Not surprisingly, the POSIX_C_LIB_EXT Option Group also includes the highly debated strnlen() function. Moving that function will be deferred until later. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>pull/73756/head
24 changed files with 115 additions and 104 deletions
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
# Copyright (c) 2024 Tenstorrent AI ULC |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
menuconfig POSIX_C_LIB_EXT |
||||
bool "POSIX general C library extension" |
||||
default y if POSIX_API |
||||
help |
||||
Select 'y' here and Zephyr will provide an implementation of the POSIX_C_LIB_EXT Option |
||||
Group, consisting of fnmatch(), getopt(), getsubopt(), optarg, opterr, optind, optopt, |
||||
stpcpy(), stpncpy(), strcasecmp(), strdup(), strfmon(), and strncasecmp(), strndup(), and |
||||
strnlen(). |
||||
|
||||
For more informnation, please see |
||||
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html |
||||
|
||||
if POSIX_C_LIB_EXT |
||||
|
||||
config GETOPT_LONG |
||||
bool "Getopt long library support" |
||||
help |
||||
This option adds support of the getopt long. |
||||
Different shell backends are using their own instance of getopt to |
||||
not interfere with each other. |
||||
All not shell threads share one global instance of getopt state, hence |
||||
apart from shell this library is not thread safe. User can add support |
||||
for other threads by extending function getopt_state_get in |
||||
getopt_common.c file. |
||||
|
||||
endif # POSIX_C_LIB_EXT |
@ -1,10 +0,0 @@
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2018 Nordic Semiconductor ASA |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config FNMATCH |
||||
bool "Support for fnmatch" |
||||
default y if POSIX_API |
||||
help |
||||
Match filenames using the the fnmatch function. For example, the pattern |
||||
"*.c" matches the filename "hello.c". |
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2024 Google LLC |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
DT_CHOSEN_ZEPHYR_ENTROPY := zephyr,entropy |
||||
|
||||
config GETENTROPY |
||||
bool "Support for getentropy" |
||||
depends on !NATIVE_APPLICATION |
||||
select NATIVE_LIBC_INCOMPATIBLE |
||||
depends on ENTROPY_HAS_DRIVER |
||||
depends on $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_ENTROPY)) |
||||
help |
||||
Enable support for getentropy() function. |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
rsource "getopt/Kconfig" |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
# |
||||
|
||||
zephyr_include_directories_ifdef( |
||||
CONFIG_GETOPT |
||||
. |
||||
) |
||||
|
||||
zephyr_sources_ifdef( |
||||
CONFIG_GETOPT |
||||
getopt.c |
||||
getopt_common.c |
||||
) |
||||
|
||||
zephyr_sources_ifdef( |
||||
CONFIG_GETOPT_LONG |
||||
getopt_long.c |
||||
) |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
|
||||
menuconfig GETOPT |
||||
bool "Getopt library support" |
||||
default y if POSIX_API |
||||
help |
||||
This option adds support of getopt. |
||||
Different shell backends are use their own instance of getopt to |
||||
not interfere with each other. |
||||
All not shell threads share one global instance of getopt state, hence |
||||
apart from shell this library is not thread safe. User can add support |
||||
for other threads by extending function getopt_state_get in |
||||
getopt_common.c file. |
||||
This option enables the following function: getopt. |
||||
|
||||
config GETOPT_LONG |
||||
bool "Getopt long library support" |
||||
depends on GETOPT |
||||
help |
||||
This option adds support of the getopt long. |
||||
Different shell backends are using their own instance of getopt to |
||||
not interfere with each other. |
||||
All not shell threads share one global instance of getopt state, hence |
||||
apart from shell this library is not thread safe. User can add support |
||||
for other threads by extending function getopt_state_get in |
||||
getopt_common.c file. |
@ -1,4 +1,3 @@
@@ -1,4 +1,3 @@
|
||||
CONFIG_ENTROPY_GENERATOR=y |
||||
CONFIG_GETENTROPY=y |
||||
CONFIG_POSIX_API=y |
||||
CONFIG_POSIX_C_LIB_EXT=y |
||||
CONFIG_ZTEST=y |
||||
|
Loading…
Reference in new issue