nuttx/libs/libc/unistd/Kconfig

102 lines
4.0 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() familty of functions that can be used 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 compatibily 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 if !BUILD_KERNEL
default y if 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.
endif # EXECFUNCS_HAVE_SYMTAB
endif # LIBC_EXECFUNCS
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 2048
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