nuttx/sched/task
dongjiuzhu1 18819b6b24 sched/task: close file descriptor with O_CLOEXEC before active task or exec
VELAPLATFO-18473

refs:
https://man7.org/linux/man-pages/man2/fcntl.2.html
If the FD_CLOEXEC bit is set, the file descriptor will automatically
be closed during a successful execve(2).
(If the execve(2) fails, the file descriptor is left open.)

modify:
1. Ensure that the child task copies all fds of the parent task,
   including those with O_CLOEXE.
2. Make sure spawn_file_action is executed under fd with O_CLOEXEC,
   otherwise it will fail.
3. When a new task is activated or exec is called, close all fds
   with O_CLOEXEC flags.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-27 21:15:07 +08:00
..
CMakeLists.txt cmake:complete missing changes during cmake reforming for sched 2023-09-08 21:20:16 +03:00
exit.c
Make.defs tls: Move task_tls_alloc and task_tls_destruct to libc 2023-08-28 11:02:18 +03:00
spawn.h sched/spawn: remove spawn proxy thread to simplify task/posix_spawn() 2023-04-27 17:35:58 +08:00
task_activate.c
task_cancelpt.c libc/exit: Purge calls to userspace API exit() from kernel 2023-02-17 23:07:17 +08:00
task_create.c sched/task: close file descriptor with O_CLOEXEC before active task or exec 2023-10-27 21:15:07 +08:00
task_delete.c sched: fix the minor style issue 2023-10-25 15:46:45 +08:00
task_execve.c libc/exit: Purge calls to userspace API exit() from kernel 2023-02-17 23:07:17 +08:00
task_exit.c
task_exithook.c replace nxsched_gettid with nxsched_getpid. 2023-08-04 04:21:08 -07:00
task_fork.c mm/alloc: remove all unnecessary cast for alloc 2023-08-30 14:34:20 +08:00
task_getgroup.c
task_getpid.c
task_getppid.c
task_gettid.c
task_init.c add the startup process tracepoint 2023-08-19 21:50:08 +08:00
task_posixspawn.c sched/task_[posix]spawn: Simplify how spawn attributes are handled 2023-10-25 11:55:44 -03:00
task_prctl.c
task_recover.c
task_reparent.c
task_restart.c semantic/parser: fix compile warning found by sparse 2023-05-30 23:00:00 +08:00
task_setcancelstate.c libc/exit: Purge calls to userspace API exit() from kernel 2023-02-17 23:07:17 +08:00
task_setcanceltype.c libc/exit: Purge calls to userspace API exit() from kernel 2023-02-17 23:07:17 +08:00
task_setup.c sched: remove space in task name 2023-08-11 13:27:17 +08:00
task_spawn.c sched/task: close file descriptor with O_CLOEXEC before active task or exec 2023-10-27 21:15:07 +08:00
task_spawnparms.c task_spawnparms: out of loop when ret less than 0 2023-07-31 00:47:42 -07:00
task_start.c libc/exit: Purge calls to userspace API exit() from kernel 2023-02-17 23:07:17 +08:00
task_starthook.c
task_terminate.c sched: Fix nxstyle errors 2023-05-11 11:25:58 -03:00
task_testcancel.c
task.h