nuttx/libs/libc/unistd/Kconfig
田昕 24bd80eb84 unistd:rename CONFIG_OPEN_MAX to CONFIG_LIBC_OPEN_MAX
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-01 22:10:51 +08:00

153 lines
5.6 KiB
Plaintext

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "Program Execution Options"
config LIBC_EXECFUNCS
bool "Enable exec[l|v] / posix_spawn() Support"
default n
depends on !BINFMT_DISABLE
---help---
Enable support for the exec[l|v] family of functions that can be
used to start other programs, terminating the current program and
the posix_spawn() family of functions that can be used to start other
programs without terminating the current program. The typical
usage of the exec[l|v] functions is (1) first call vfork() to create
a new thread, then (2) call exec[l|v] to replace the new thread with
a program from the file system.
NOTE 1: This two step process start is completely unnecessary in
NuttX and is provided only for compatibility with Unix systems. These
functions are essentially just wrapper functions that (1) call the
non-standard binfmt function 'exec', and then (2) exit(0). Since
the new thread will be terminated by the exec[l|v] call, it really
served no purpose other than to suport Unix compatility.
The posix_spawn() functions do not have this inefficiency.
NOTE 2: Support for exec[l|v] and posix_spawn() is conditional
because they require additional support for symbol tables that
will not be available in the typical system.
if LIBC_EXECFUNCS
config EXECFUNCS_HAVE_SYMTAB
bool "Have symbol table"
default n
depends on !BUILD_KERNEL
---help---
If you have a system symbol table, then you may select this
option in order to use it. Symbol tables are required in most
cases in order to link executable programs to the base code.
NOTE: This option only pre-initializes the system symbol table as
defined by CONFIG_EXECFUNCS_SYMTAB_ARRAY and CONFIG_EXECFUNCS_NSYMBOLS_VAR.
This is simply an optional, automatic initialization of the
system symbol table. You would need to do this, for example, in
in the kernel build were the first task must be run from a program
on the file system. This option has no other effect.
Optionally, you can always call binfmt_setsymtab() from your
board-specific logic or, equivalently, call boardctl(BOARDIOC_APP_SYMTAB)
from your application initialization logic.
if EXECFUNCS_HAVE_SYMTAB
config EXECFUNCS_SYMTAB_ARRAY
string "Symbol table name used by exec[l|v]"
default "g_symtab"
---help---
The exec[l|v] and posix_spawn() functions are wrapper functions that
call the non-standard binfmt function 'exec'). The binfmt
function 'exec' needs to have (1) a symbol table that provides the
list of symbols exported by the base code, and (2) the number of
symbols in that table. This selection provides the name of that
symbol table.
config EXECFUNCS_NSYMBOLS_VAR
string "Name of variable holding the number of symbols"
default "g_nsymbols"
---help---
The exec[l|v] and posix_spawn() functions are wrapper functions that
call the non-standard binfmt function 'exec'). The binfmt
function 'exec' needs to have (1) a symbol table that provides the
list of symbols exported by the base code, and (2) the number of
symbols in that table. This selection provides the name of an 'int'
variable that contains the number of symbols in the symbol table.
config EXECFUNCS_SYSTEM_SYMTAB
bool "Generate and include system symbol table"
default n
---help---
Generate symbol table which includes symbols for all available
syscalls, libc and libm functions. It makes system significantly
larger but actual applications can reuse maximum from the system
image.
The symbol table array is named g_symtab and variable holding
number of exported symbols g_nsymbols. It matches expected defaults
from entries above. But they can be changed and generated symbol table
can be used as template by application.
endif # EXECFUNCS_HAVE_SYMTAB
endif # LIBC_EXECFUNCS
config SYMTAB_ORDEREDBYNAME
bool "Symbol Tables Ordered by Name"
default n
---help---
Select if the symbol table is ordered by symbol name. In this case,
the logic can perform faster lookups using a binary search.
Otherwise, the symbol table is assumed to be un-ordered and only
slow, linear searches are supported.
config SYMTAB_ORDEREDBYVALUE
bool "Symbol Tables Ordered by Value"
default n
---help---
Select if the symbol table is ordered by symbol value.
config SYMTAB_DECORATED
bool "Symbols are decorated with leading underscores"
default n
---help---
Select if symbols in relocatable objects are decorated with a leading
underscore. This option will remove the underscore from symbol names
when relocating a loadable object.
config POSIX_SPAWN_PROXY_STACKSIZE
int "Spawn Stack Size"
default 1024
---help---
If posix_spawn[p]() and task_spawn() use I/O redirection options,
they will require an intermediary/proxy task to muck with the file
descriptors. This configuration item specifies the stack size
used for the proxy. Default: 1024 bytes.
config TASK_SPAWN_DEFAULT_STACKSIZE
int "Default task_spawn Stack Size"
default DEFAULT_TASK_STACKSIZE
depends on !ARCH_ADDRENV
---help---
The actual size to use for the child task's stack can be set with
task_spawnattr_setstacksize(). This value specifies the default
stack size to use if task_spawnattr_setstacksize() is not used.
Default: 2048.
endmenu # Program Execution Options
config LIBC_HOSTNAME
string "Host name for this device"
default ""
---help---
A unique name to identify device on the network
config LIBC_OPEN_MAX
int "OPEN_MAX for this device"
default 255
---help---
The maximum number of files that a process can have open
at any time. Must not be less than _POSIX_OPEN_MAX.