Setting the pid to 0 will send the SIGABRT signal to "every process in the process group of the calling process". This means that darlingserver will also get killed as a result (which we don't want to happen).
Instead of duplicating the assembly code, let's have a shared function that both "sys_workq_kernreturn" and "wqueue_entry_point_wrapper" can use to jump to "_start_wqthread".
In `libpthread/src/pthread_asm.S`, `_thread_start` and `_start_wqthread` are designed with the assumption that the code would run from kernel space. This means that the following functions don't follow all of the standard calling conventions that are expected for x86_64 or i386.
Our previous choices for per-thread-WD keys were conflicting with the
keys reserved for the Swift runtime and causing crashes for Swift apps.
Instead, let's use some keys from the newly-reserved Darling range for
pthread keys (200-209). This range seems to be otherwise unused, so it
should be fine for us to use it.
Implemented AT_REMOVEDIR_DATALESS and AT_FDONLY flags.
Implemented the error EINVAL for invalid flags that are passed to *at
functions.
Added AT_EACCESS and AT_REALDEV flags but are currently ignored.