This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 3129c063907 arch/arm64: disable fork support in protected build mode
3129c063907 is described below

commit 3129c063907bf1949c4f89ac59921aafe36ec6bd
Author: hujun5 <[email protected]>
AuthorDate: Sat Apr 26 15:27:55 2025 +0800

    arch/arm64: disable fork support in protected build mode
    
    Modify ARM64 architecture configuration to disable fork support in protected
    build mode (BUILD_PROTECTED). Update ARCH_HAVE_FORK condition from
    "!BUILD_KERNEL" to "!BUILD_KERNEL && !BUILD_PROTECTED", ensuring fork is
    only available in flat/monolithic builds, not in protected kernel builds.
    
    Signed-off-by: hujun5 <[email protected]>
---
 Documentation/reference/user/01_task_control.rst | 4 +++-
 arch/Kconfig                                     | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/reference/user/01_task_control.rst 
b/Documentation/reference/user/01_task_control.rst
index 60d22a0288d..e673d712776 100644
--- a/Documentation/reference/user/01_task_control.rst
+++ b/Documentation/reference/user/01_task_control.rst
@@ -358,7 +358,9 @@ Functions
      NOTE: ``vfork()`` is not an independent NuttX feature, but is
      implemented in architecture-specific logic (using only helper
      functions from the NuttX core logic). As a result, ``vfork()`` may
-     not be available on all architectures.
+     not be available on all architectures. The current implementation in
+     NuttX arm64 only guarantees that ``vfork()`` works when
+     CONFIG_BUILD_FLAT=y.
 
   :return: Upon successful completion, ``vfork()`` returns 0 to
     the child process and returns the process ID of the child process to the
diff --git a/arch/Kconfig b/arch/Kconfig
index e54b8a128a4..0ddcdb50c40 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -29,7 +29,7 @@ config ARCH_ARM64
        select ARCH_64BIT
        select ARCH_HAVE_BACKTRACE
        select ARCH_HAVE_INTERRUPTSTACK
-       select ARCH_HAVE_FORK if !BUILD_KERNEL
+       select ARCH_HAVE_FORK if !BUILD_KERNEL && !BUILD_PROTECTED
        select ARCH_HAVE_STACKCHECK
        select ARCH_HAVE_CUSTOMOPT
        select ARCH_HAVE_STDARG_H

Reply via email to