walnux/include/nuttx
Ville Juven 9638187192 sched/nxtask_sigchild: Set process exit code to group exit code
There is an issue where the wrong process exit code is given to the parent
when a process exits. This happens when the process has pthreads running
user code i.e. not within a cancel point / system call.

Why does this happen ?

When exit() is called, the following steps are done:
- group_kill_children(), which tells the children to die via pthread_cancel()

Then, one of two things can happen:
1. if the child is in a cancel point, it gets scheduled to allow it to leave
   the cancel point and gets destroyed immediately
2. if the child is not in a cancel point, a "cancel pending" flag is set and
   the child will die when the next cancel point is encountered

So what is the problem here?

The last thread alive dispatches SIGCHLD to the parent, which carries the
process's exit code. The group head has the only meaningful exit code and
this is what should be passed. However, in the second case, the group head
exits before the child, taking the process exit code to its grave. The child
that was alive will exit next and will pass its "status" to the parent process,
but this status is not the correct value to pass.

This commit fixes the issue by passing the group head's exit code ALWAYS to
the parent process.
2023-02-10 00:36:30 +08:00
..
1wire include: Haltian Ltd: update licenses to Apache 2021-11-15 06:49:32 -06:00
analog Call nxsem_destroy or nxmutex_destry in the error path 2022-10-30 13:56:52 +01:00
audio feature:add audio AUDIOIOC_SETPARAMTER ioctl command 2023-01-29 14:40:40 +08:00
binfmt sched/addrenv: Remove up_addrenv_restore 2023-02-08 02:51:23 +08:00
can Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
clk nuttx: unify FAR attribute usage across the code 2022-04-04 21:32:58 +08:00
contactless author: OffCode Ltd : update licenses to Apache 2021-09-13 22:43:36 +08:00
crypto crypto: Initial copy from https://github.com/openbsd/sys/crypto 2022-12-14 02:33:56 +08:00
drivers Call nxsem_destroy or nxmutex_destry in the error path 2022-10-30 13:56:52 +01:00
eeprom include: fix double include pre-processor guards 2022-01-16 11:11:14 -03:00
efuse
fs fs/smart: fix visual studio Compiler Error C2016 2023-02-09 20:11:55 +08:00
himem include: himem: Add Apache license to files 2022-04-20 21:05:45 +08:00
hwspinlock hwspinlock: add hwspinlock driver for multi CPU 2022-11-09 09:12:01 +01:00
i2c Added I2C Slave to RP2040 2022-07-16 01:56:52 +08:00
input touch: Add ioctl to enable/disable gesture 2023-02-02 22:48:00 +08:00
ioexpander ioexpander: Fix typos in comments 2022-08-15 10:25:11 +08:00
lcd libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc) 2022-12-05 14:27:55 +01:00
leds Add LP503x RGB LED driver 2022-12-22 13:39:05 +08:00
lib libs: workaround for Visual Studio(MSVC) Compiler Error C2124 2023-02-09 20:11:55 +08:00
math add upper-half CORDIC driver 2021-07-28 14:23:13 -03:00
mbox drivers/mbox: Don't reference the nonexistent CONFIG_MBOX 2022-11-07 10:14:20 +01:00
mm mm/iob: Support negative offset when copyin/out. 2023-01-31 00:39:15 +08:00
modem add holder for mutex 2023-01-31 12:08:05 +09:00
motor motor: Add calibration and selftest 2023-01-28 19:54:35 +02:00
mtd fs: Add model field to geometry and mtd_geometry_s 2023-01-31 11:50:28 -03:00
net net/netfilter: fix visual studio Compiler Error C2229 2023-02-09 20:11:55 +08:00
note drivers/segger: register sysview to note drivers list 2023-01-05 22:04:52 +08:00
nx Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
power Charge: Add cut-off current interface 2023-02-01 09:51:31 -03:00
rc Replece clock_gettime(CLOCK_MONOTONIC) with clock_systime_timespec 2022-02-24 01:06:36 +08:00
rf include: fix double include pre-processor guards 2022-01-16 11:11:14 -03:00
rptun rptun: add ns_match callback to resolve rptun deadlock 2022-07-27 20:36:51 +08:00
segger sergger: add note_ prefix to sysview 2023-01-05 22:04:52 +08:00
sensors sensor: Report more gps info 2023-02-02 22:49:27 +08:00
serial drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
spi Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
syslog drivers/syslog:support stream as syslog backend. 2022-11-28 20:19:00 +08:00
timers include/nuttx/timers/pwm: Add user provided argument in struct pwm_info_s 2023-01-28 19:55:46 +02:00
usb nuttx: add some missing FAR 2022-12-21 10:56:45 +08:00
usrsock move usrsock to kernel space 2023-01-11 15:14:03 +08:00
video drivers/video: add timestamp support 2023-02-09 23:27:15 +08:00
virtio virtio: Add virtio drivers 2022-11-29 13:16:44 +08:00
wireless nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems() 2023-02-09 20:05:44 +08:00
.gitignore
addrenv.h sched/addrenv: Remove up_addrenv_restore 2023-02-08 02:51:23 +08:00
allsyms.h libc/allsyms: Load all symbols for debugging 2021-12-13 08:31:13 -06:00
arch.h sched/addrenv: Remove up_addrenv_restore 2023-02-08 02:51:23 +08:00
ascii.h
atexit.h libc: Implement quick_exit and at_quick_exit 2023-01-25 14:31:37 +02:00
board.h board: Pass the assertion expression to board_crashdump too 2023-01-25 16:00:48 -03:00
cache.h arch:cache: add lock feature for cache 2021-10-22 13:31:32 -03:00
can.h stm32h7: socket CAN error handling. 2023-01-30 11:22:49 +08:00
cancelpt.h
clock.h include/nuttx/clock.h: Change ?SEC2TICK macros to round up and fix nxstyle errors 2023-01-31 22:42:29 +08:00
compiler.h compiler.h: Add _ between format|printf|syslog|scanf|strftime and like 2022-12-21 01:05:19 +02:00
crc8.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc16.h arm64/a64: Add driver for MIPI DSI 2022-12-14 22:37:32 +08:00
crc32.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc64.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
elf.h binfmt/elf: add bare metal coredump support 2021-11-23 20:48:00 -06:00
environ.h
envpath.h Rename LIB_ to LIBC_ for all libc Kconfig 2021-08-05 19:45:24 +02:00
hashtable.h hashtable.h: Added a hashtable implementation 2022-12-22 20:20:12 +08:00
init.h boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT 2022-10-16 19:02:44 +02:00
ipcc.h stm32wl5: fix unbuffered mode and other possible bugs 2022-08-18 11:46:38 +08:00
irq.h SMP: fix crash when switch to new task which is still running 2022-09-17 17:37:47 +09:00
kmalloc.h mm: add kmm/umm_memdump 2022-10-29 11:35:27 +08:00
kthread.h sched/spawn: Support task_spawnattr_[set|get]stackaddr 2022-10-31 12:46:58 +09:00
lirc.h
list.h list.h: Add local temp variable to avoid the double evaluation 2022-10-06 08:29:39 +02:00
mmcsd.h drivers/mmcsd: Add MMC_IOC_CMD ioctl 2023-01-30 14:09:23 -03:00
module.h
mqueue.h sched/mqueue: decoupling condition member to common prologue 2022-10-22 12:58:11 +08:00
mutex.h misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock() 2023-02-04 02:13:15 +08:00
notifier.h sched/misc:add linux-like reboot notifier list 2022-12-29 19:18:42 +08:00
nuttx.h
page.h nuttx/sched: merge up_block_task and up_unblock_task 2022-11-22 22:59:08 +08:00
panic_notifier.h assert:add a last type to call notifier 2023-01-05 22:58:00 +08:00
pgalloc.h
progmem.h progmem: eliminate PROGMEM_ERASESTATE configuration option 2022-03-22 10:01:41 -03:00
pthread.h sched: Map SCHED_OTHER to SCHED_FIFO or SCHED_RR 2023-01-30 03:01:03 +02:00
queue.h net/nat: Add TCP entry expiration logic 2022-11-11 14:36:55 +08:00
random.h include: Haltian Ltd: update licenses to Apache 2021-11-15 06:49:32 -06:00
reboot_notifier.h sched/misc:add linux-like reboot notifier list 2022-12-29 19:18:42 +08:00
sched.h sched/nxtask_sigchild: Set process exit code to group exit code 2023-02-10 00:36:30 +08:00
sched_note.h sched_note: add SCHED_NOTE_BEGIN/ENDEX interface 2023-02-08 13:31:46 +08:00
scsi.h
sdio.h mmcsd: Add FAR to the pointer argument 2022-05-13 15:41:27 +03:00
semaphore.h add holder for mutex 2023-01-31 12:08:05 +09:00
signal.h signal/nxsig_pengingset: move nxsig_pendingset to common header 2022-12-28 23:05:58 +08:00
spawn.h sched/task: Simplify the syscall handling of task_spawn 2021-06-01 12:45:10 +09:00
spinlock.h spinlock: Move spinlock_init to public macros 2023-02-02 22:47:34 +08:00
streams.h syslog: fix extra line breaks in syslog when SYSLOG_COLOR_OUTPUT is enabled 2023-01-02 21:22:46 +08:00
symtab.h
time.h libs/libc/time: mktime normalize struct tm 2022-10-27 21:22:08 +08:00
tls.h fs/streams: Move the file streams from the group structure into TLS 2022-12-22 20:16:11 +08:00
userspace.h Rename LIB_ to LIBC_ for all libc Kconfig 2021-08-05 19:45:24 +02:00
vt100.h
wdog.h libc: Move queue.h from include to include/nuttx 2022-09-26 08:04:58 +02:00
wqueue.h libc: Move queue.h from include to include/nuttx 2022-09-26 08:04:58 +02:00
zoneinfo.h Rename LIB_ to LIBC_ for all libc Kconfig 2021-08-05 19:45:24 +02:00