nuttx/include
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
..
arpa
crypto crypto:support crypto can handle streaming data 2023-01-17 01:19:38 +08:00
cxx libc: Implement quick_exit and at_quick_exit 2023-01-25 14:31:37 +02:00
net net/route.h: add RTF_XX flags and rt_dev member 2023-01-29 14:29:52 +08:00
netinet support ipv4 ToS and ipv6 TrafficClass 2023-01-29 13:43:44 +08:00
netpacket netlink: add RTA_MAX definition 2023-01-06 22:20:19 +08:00
nuttx sched/nxtask_sigchild: Set process exit code to group exit code 2023-02-10 00:36:30 +08:00
ssp
sys sys/sysinfo: align sysinfo define with linux 2023-02-09 20:11:55 +08:00
.gitignore
aio.h
alloca.h
assert.h libc: Define _assert/__assert to avoid 3rd libary redefine them 2023-02-06 15:04:30 +01:00
byteswap.h
ctype.h
debug.h nuttx: add some missing FAR 2022-12-21 10:56:45 +08:00
dirent.h fs: Define DT_xxx to number directly 2023-01-19 00:52:25 +02:00
dlfcn.h
dsp.h
dspb16.h
elf32.h
elf64.h
elf.h
endian.h libc: Add sys/endian.h to improve the compatiblity with bionic libc 2023-01-15 12:26:15 -03:00
err.h nuttx: add some missing FAR 2022-12-21 10:56:45 +08:00
errno.h
execinfo.h sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
fcntl.h fs: support openat/fchmodat/mkfifoat/fstatat/...at api 2023-02-07 03:45:38 +08:00
fixedmath.h
fnmatch.h
ftw.h
getopt.h
glob.h
grp.h
hex2bin.h libc/hex2bin: Remove the unused declaration 2022-12-05 10:42:22 +01:00
ifaddrs.h
inttypes.h
iso646.h
langinfo.h
libgen.h
libintl.h compiler.h: Add _ between format|printf|syslog|scanf|strftime and like 2022-12-21 01:05:19 +02:00
limits.h sched: Map both NZERO and PTHREAD_DEFAULT_PRIORITY to SCHED_PRIORITY_DEFAULT 2023-01-24 08:06:42 +01:00
locale.h
lzf.h
malloc.h adjust the contents of memdump and meminfo 2023-01-17 16:48:30 +08:00
mqueue.h
netdb.h libc/netdb: add proto.c 2022-12-10 02:36:24 +08:00
nl_types.h
nxflat.h
obstack.h compiler.h: Add _ between format|printf|syslog|scanf|strftime and like 2022-12-21 01:05:19 +02:00
poll.h
pthread.h libc/pthread: Implement pthread_condattr_[set|get]pshared 2023-01-24 13:53:02 -03:00
pty.h
pwd.h libc/passwd: add pw_gecos field(userinfo) 2022-12-30 00:21:15 +08:00
resolv.h
sched.h sched: Map SCHED_OTHER to SCHED_FIFO or SCHED_RR 2023-01-30 03:01:03 +02:00
semaphore.h add holder for mutex 2023-01-31 12:08:05 +09:00
signal.h signal: add marco _NSIG 2023-01-27 13:21:49 -03:00
spawn.h
stdbool.h
stddef.h
stdint.h
stdio.h fs: support openat/fchmodat/mkfifoat/fstatat/...at api 2023-02-07 03:45:38 +08:00
stdlib.h libc: Implement quick_exit and at_quick_exit 2023-01-25 14:31:37 +02:00
stdnoreturn.h
string.h libc/versionsort: support versionsort and strverscmp 2023-01-15 11:24:40 +08:00
strings.h
syscall.h syscall: export UP_WRAPSYM/UP_REALSYM macro 2022-12-30 22:13:34 +08:00
syslog.h compiler.h: Add _ between format|printf|syslog|scanf|strftime and like 2022-12-21 01:05:19 +02:00
termios.h
threads.h sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
time.h time.h: Add CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID definition 2023-01-26 13:00:23 +02:00
unistd.h Move SEEK_xxx from unistd.h to sys/types.h 2023-02-07 12:16:22 +02:00
utime.h
uuid.h
wchar.h
wctype.h