Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions include/nuttx/lib/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@
#include <nuttx/config.h>
#include <sys/types.h>

#ifdef CONFIG_BUILTIN
#ifdef CONFIG_APP_REGISTRY

/****************************************************************************
* Public Types
****************************************************************************/

/* Under CONFIG_BUILD_KERNEL, only priority/stacksize are consumed; main
* (and uid/gid/mode, if enabled) are populated but unused.
*/

struct builtin_s
{
FAR const char *name; /* Invocation name and as seen under /sbin/ */
Expand Down Expand Up @@ -241,5 +245,5 @@ int builtin_getmode(int index);
}
#endif

#endif /* CONFIG_BUILTIN */
#endif /* CONFIG_APP_REGISTRY */
#endif /* __INCLUDE_NUTTX_LIB_BUILTIN_H */
2 changes: 1 addition & 1 deletion libs/libc/builtin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# ##############################################################################

if(CONFIG_BUILTIN)
if(CONFIG_APP_REGISTRY)
set(SRCS lib_builtin_getname.c lib_builtin_isavail.c lib_builtin_forindex.c)

if(CONFIG_BUILD_PROTECTED)
Expand Down
12 changes: 12 additions & 0 deletions libs/libc/builtin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ config BUILTIN
those names in a file system from which they can be executed. This feature
is also the underlying requirement to support built-in applications in the
NuttShell (NSH).

config APP_REGISTRY
bool
default y if BUILTIN || BUILD_KERNEL
Comment thread
xiaoxiang781216 marked this conversation as resolved.
---help---
Hidden option indicating that the compile-time name/priority/stacksize
registry table for applications (struct builtin_s / g_builtins[]) is
available. This is a broader condition than BUILTIN: BUILD_KERNEL
cannot select BUILTIN (main_t dispatch is meaningless when the caller
and the application are in different address spaces), but it still
needs this table so that posix_spawn() can pick up each application's
configured priority and stack size.
2 changes: 1 addition & 1 deletion libs/libc/builtin/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
############################################################################

ifeq ($(CONFIG_BUILTIN),y)
ifneq ($(CONFIG_APP_REGISTRY),)
Comment thread
acassis marked this conversation as resolved.

# Builtin library files

Expand Down
Loading