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
1 change: 1 addition & 0 deletions netutils/dropbear/port/nuttx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CONST_GAI_STRERROR_PROTO 1
#define HAVE_CRYPT 1
#define HAVE_DAEMON 1
#define HAVE_DECL_HTOLE64 1
#define HAVE_ENDIAN_H 1
#define HAVE_EXPLICIT_BZERO 1
Expand Down
7 changes: 7 additions & 0 deletions system/libuv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ if(CONFIG_LIBUV)
${LIBUV_TEST_DIR}/run-tests.c ${LIBUV_TEST_DIR}/runner.c
${LIBUV_TEST_DIR}/runner-unix.c ${LIBUV_TEST_DIR}/echo-server.c)
file(GLOB TEST_CSRCS ${LIBUV_TEST_DIR}/test-*.c)

# See system/libuv/Makefile.

if(NOT CONFIG_ARCH_HAVE_FORK)
list(REMOVE_ITEM TEST_CSRCS ${LIBUV_TEST_DIR}/test-fork.c
${LIBUV_TEST_DIR}/test-pipe-close-stdout-read-stdin.c)
endif()
list(APPEND LIBUV_UTILS_TEST_SRCS ${TEST_CSRCS})
nuttx_add_application(
NAME
Expand Down
14 changes: 13 additions & 1 deletion system/libuv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,19 @@ CSRCS += runner.c
CSRCS += runner-unix.c
CSRCS += echo-server.c

CSRCS += $(wildcard libuv/test/test-*.c)
LIBUV_TEST_CSRCS = $(wildcard libuv/test/test-*.c)

# test-fork.c and test-pipe-close-stdout-read-stdin.c call fork(), so they
# cannot be built where NuttX does not provide it. Nothing is lost either
# way: every test they define is already excluded from the task list on
# NuttX by 0001-libuv-port-for-nuttx.patch.

ifeq ($(CONFIG_ARCH_HAVE_FORK),)
LIBUV_TEST_CSRCS := $(filter-out libuv/test/test-fork.c,$(LIBUV_TEST_CSRCS))
LIBUV_TEST_CSRCS := $(filter-out libuv/test/test-pipe-close-stdout-read-stdin.c,$(LIBUV_TEST_CSRCS))
endif

CSRCS += $(LIBUV_TEST_CSRCS)
endif

ifneq ($(CONFIG_LIBUV_UTILS_BENCHMARK),)
Expand Down
43 changes: 29 additions & 14 deletions testing/drivers/nand_sim/nand_sim_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************/

#include <nuttx/debug.h>
#include <sched.h>
#include <stdio.h>

#include <nuttx/drivers/drivers.h>
Expand Down Expand Up @@ -128,26 +129,17 @@ void terminate(int sig)
}

/****************************************************************************
* Name: nand_sim_main
* Name: nand_sim_daemon
*
* Description:
* Entry point of the device emulator.
* Body of the device emulator. Registers the simulated MTD device and
* then sleeps forever; all events are handled by signals.
*
****************************************************************************/

int main(int argc, FAR char *argv[])
static int nand_sim_daemon(int argc, FAR char *argv[])
{
int ret;
pid_t pid;

/* Daemon */

pid = fork();

if (pid > 0)
{
return OK;
}
int ret;

if (daemon(0, 1) == -1)
{
Expand Down Expand Up @@ -223,3 +215,26 @@ int main(int argc, FAR char *argv[])
errout:
return ret;
}

/****************************************************************************
* Name: nand_sim_main
*
* Description:
* Entry point of the device emulator. Starts the emulator as an
* independent task so that the caller gets its shell back.
*
****************************************************************************/

int main(int argc, FAR char *argv[])
{
int ret;

ret = task_create(NAND_SIM_NAME, SCHED_PRIORITY_DEFAULT,
CONFIG_TESTING_NAND_SIM_STACK, nand_sim_daemon, NULL);
if (ret < 0)
{
return EXIT_FAILURE;
}

return OK;
}
6 changes: 6 additions & 0 deletions testing/ltp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ if(CONFIG_TESTING_LTP)
list(APPEND BLACKWORDS "pthread_spin_init" "pthread_spin_destroy"
"pthread_spin_trylock")
endif()

# See testing/ltp/Makefile.

if(NOT CONFIG_ARCH_HAVE_FORK)
list(APPEND BLACKWORDS "[^v_]fork(")
endif()
list(
APPEND
BLACKWORDS
Expand Down
7 changes: 7 additions & 0 deletions testing/ltp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ BLACKWORDS += "pthread_spin_destroy"
BLACKWORDS += "pthread_spin_trylock"
endif

# Where NuttX does not declare fork(), a test that calls it cannot be built.
# The pattern spares vfork() and task_fork(), which remain available.

ifeq ($(CONFIG_ARCH_HAVE_FORK),)
BLACKWORDS += "[^v_]fork("
endif

BLACKWORDS += "CHILD_MAX"
BLACKWORDS += "setpgid("
BLACKWORDS += "PTHREAD_SCOPE_PROCESS"
Expand Down
Loading