diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index 8f1a510e0..3f5f878ac 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -114,7 +114,7 @@ ifeq ($(CONFIG_ARCH_HAVE_FORK),y) else @echo "export ac_cv_func_fork=\"no\"" >> $@ endif -ifneq ($(CONFIG_ARCH_HAVE_VFORK)$(CONFIG_ARCH_HAVE_FORK),) +ifeq ($(CONFIG_ARCH_HAVE_VFORK),y) @echo "export ac_cv_func_vfork=\"yes\"" >> $@ else @echo "export ac_cv_func_vfork=\"no\"" >> $@ diff --git a/netutils/libwebsockets/lws_config_private.h b/netutils/libwebsockets/lws_config_private.h index cacf92f5f..057baf73b 100644 --- a/netutils/libwebsockets/lws_config_private.h +++ b/netutils/libwebsockets/lws_config_private.h @@ -119,7 +119,7 @@ #endif /* Define to 1 if `vfork' works. */ -#if defined(CONFIG_ARCH_HAVE_VFORK) || defined(CONFIG_ARCH_HAVE_FORK) +#ifdef CONFIG_ARCH_HAVE_VFORK #define LWS_HAVE_WORKING_VFORK #endif diff --git a/testing/drivers/nand_sim/Kconfig b/testing/drivers/nand_sim/Kconfig index 4baa4425e..008446a89 100644 --- a/testing/drivers/nand_sim/Kconfig +++ b/testing/drivers/nand_sim/Kconfig @@ -5,8 +5,7 @@ config TESTING_NAND_SIM boolean "NAND Flash Simulator" - depends on MTD_NAND_RAM && ENABLE_ALL_SIGNALS - depends on TASK_FORK || (ARCH_HAVE_FORK && !ARCH_HAVE_TASK_FORK) + depends on MTD_NAND_RAM && ENABLE_ALL_SIGNALS && TASK_FORK default n ---help--- Enable the NAND Flash Simulator device. diff --git a/testing/drivers/nand_sim/nand_sim_main.c b/testing/drivers/nand_sim/nand_sim_main.c index 90597faa4..c45df4af8 100644 --- a/testing/drivers/nand_sim/nand_sim_main.c +++ b/testing/drivers/nand_sim/nand_sim_main.c @@ -143,14 +143,9 @@ int main(int argc, FAR char *argv[]) pid_t pid; /* task_fork() rather than fork(): this wants a clone that outlives the - * caller and shares its memory. The fallback below covers a nuttx that - * does not have task_fork() yet. + * caller and shares its memory. */ -#ifndef CONFIG_TASK_FORK -# define task_fork() fork() -#endif - pid = task_fork(); if (pid > 0) diff --git a/testing/fs/fdsantest/fdsantest_simple.c b/testing/fs/fdsantest/fdsantest_simple.c index e5dc46817..114f0aeeb 100644 --- a/testing/fs/fdsantest/fdsantest_simple.c +++ b/testing/fs/fdsantest/fdsantest_simple.c @@ -96,7 +96,7 @@ static void test_case_overflow(void **state) assert_int_equal(open_count, close_count); } -#if defined(CONFIG_ARCH_HAVE_VFORK) || defined(CONFIG_ARCH_HAVE_FORK) +#ifdef CONFIG_ARCH_HAVE_VFORK static void test_case_vfork(void **state) { int fd = open("/dev/null", O_RDONLY); @@ -131,7 +131,7 @@ int main(int argc, FAR char *argv[]) cmocka_unit_test(test_case_unowned_tagged_close), cmocka_unit_test(test_case_owned_tagged_close), cmocka_unit_test(test_case_overflow), -#if defined(CONFIG_ARCH_HAVE_VFORK) || defined(CONFIG_ARCH_HAVE_FORK) +#ifdef CONFIG_ARCH_HAVE_VFORK cmocka_unit_test(test_case_vfork), #endif }; diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt index 76c1d25d0..ba1fcb23a 100644 --- a/testing/ostest/CMakeLists.txt +++ b/testing/ostest/CMakeLists.txt @@ -143,19 +143,15 @@ if(CONFIG_TESTING_OSTEST) endif() endif() - # See testing/ostest/ostest.h for the one transitional exception. - if(CONFIG_TASK_FORK) list(APPEND SRCS task_fork.c) - elseif(CONFIG_ARCH_HAVE_FORK AND NOT CONFIG_ARCH_HAVE_TASK_FORK) - list(APPEND SRCS task_fork.c) endif() if(CONFIG_ARCH_HAVE_VFORK) list(APPEND SRCS vfork.c) endif() - if(CONFIG_ARCH_HAVE_FORK AND CONFIG_ARCH_HAVE_VFORK) + if(CONFIG_ARCH_HAVE_FORK) list(APPEND SRCS fork.c) endif() diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile index ff89753f3..b35a3bbfb 100644 --- a/testing/ostest/Makefile +++ b/testing/ostest/Makefile @@ -144,17 +144,10 @@ CSRCS += sigev_thread.c endif endif -# Each test is built where the primitive it tests exists. See ostest.h for the -# one transitional exception. +# Each test is built where the primitive it tests exists. ifeq ($(CONFIG_TASK_FORK),y) CSRCS += task_fork.c -else ifeq ($(CONFIG_ARCH_HAVE_TASK_FORK),) -# A nuttx with no ARCH_HAVE_TASK_FORK at all is the pre-split one, where -# fork() is task_fork(). This branch comes out with the split. -ifeq ($(CONFIG_ARCH_HAVE_FORK),y) -CSRCS += task_fork.c -endif endif ifeq ($(CONFIG_ARCH_HAVE_VFORK),y) @@ -162,10 +155,8 @@ CSRCS += vfork.c endif ifeq ($(CONFIG_ARCH_HAVE_FORK),y) -ifeq ($(CONFIG_ARCH_HAVE_VFORK),y) CSRCS += fork.c endif -endif ifeq ($(CONFIG_ARCH_SETJMP_H),y) CSRCS += setjmp.c diff --git a/testing/ostest/ostest.h b/testing/ostest/ostest.h index 77bf5e9f3..c8f41832a 100644 --- a/testing/ostest/ostest.h +++ b/testing/ostest/ostest.h @@ -282,55 +282,21 @@ void priority_inheritance(void); void sched_lock_test(void); -/* The fork family **********************************************************/ - -/* Until nuttx has the three separate primitives, ARCH_HAVE_FORK stands in - * for task_fork(): today's fork() *is* task_fork(), so the test that has - * always covered that primitive keeps running under its own name. A nuttx - * without ARCH_HAVE_TASK_FORK is the pre-split one, and only there does the - * substitution apply -- once the split has landed, TASK_FORK says whether - * task_fork() was built, and nothing stands in for it. - * - * vfork_test() and fork_test() deliberately have no such mapping. They - * check semantics a pre-split nuttx does not describe -- the parent - * suspension and the private copy -- and ARCH_HAVE_VFORK is the evidence - * that the split has landed. - * - * This block comes out with the split. - */ - -#if defined(CONFIG_TASK_FORK) || \ - (defined(CONFIG_ARCH_HAVE_FORK) && !defined(CONFIG_ARCH_HAVE_TASK_FORK)) -# define OSTEST_HAVE_TASK_FORK 1 -#endif - -#ifdef CONFIG_ARCH_HAVE_VFORK -# define OSTEST_HAVE_VFORK 1 -#endif - -#if defined(CONFIG_ARCH_HAVE_FORK) && defined(CONFIG_ARCH_HAVE_VFORK) -# define OSTEST_HAVE_FORK 1 -#endif - -#if defined(OSTEST_HAVE_TASK_FORK) && !defined(CONFIG_TASK_FORK) -# define task_fork() fork() -#endif - /* task_fork.c **************************************************************/ -#ifdef OSTEST_HAVE_TASK_FORK +#ifdef CONFIG_TASK_FORK int task_fork_test(void); #endif /* vfork.c ******************************************************************/ -#ifdef OSTEST_HAVE_VFORK +#ifdef CONFIG_ARCH_HAVE_VFORK int vfork_test(void); #endif /* fork.c *******************************************************************/ -#ifdef OSTEST_HAVE_FORK +#ifdef CONFIG_ARCH_HAVE_FORK int fork_test(void); #endif diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c index e717b291d..20aeba668 100644 --- a/testing/ostest/ostest_main.c +++ b/testing/ostest/ostest_main.c @@ -229,19 +229,19 @@ static int user_main(int argc, char *argv[]) * reporting a failure -- better to learn that in seconds. */ -#ifdef OSTEST_HAVE_TASK_FORK +#ifdef CONFIG_TASK_FORK printf("\nuser_main: task_fork() test\n"); task_fork_test(); check_test_memory_usage(); #endif -#ifdef OSTEST_HAVE_VFORK +#ifdef CONFIG_ARCH_HAVE_VFORK printf("\nuser_main: vfork() test\n"); vfork_test(); check_test_memory_usage(); #endif -#ifdef OSTEST_HAVE_FORK +#ifdef CONFIG_ARCH_HAVE_FORK printf("\nuser_main: fork() test\n"); fork_test(); check_test_memory_usage(); diff --git a/testing/ostest/task_fork.c b/testing/ostest/task_fork.c index 2bd00ee76..2a66e289c 100644 --- a/testing/ostest/task_fork.c +++ b/testing/ostest/task_fork.c @@ -36,8 +36,6 @@ #include "ostest.h" -#ifdef OSTEST_HAVE_TASK_FORK - /**************************************************************************** * Private Data ****************************************************************************/ @@ -94,5 +92,3 @@ int task_fork_test(void) printf("task_fork_test: Child %d ran successfully\n", pid); return 0; } - -#endif /* OSTEST_HAVE_TASK_FORK */