This commit marks the TID/PID as unavailable to mimic the behaviour of
other kernels. This change also make pthread_rwlocks from glibc work in
binary compatibility mode.
Signed-off-by: Florin Postolache <florin.postolache.of@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Andra Paraschiv <andra@unikraft.org>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #885
/**
* System global lists
+ * NOTE: We pre-allocate PID/TID 0 which is reserved by the kernel.
+ * An application should never get PID/TID 0 assigned.
*/
static struct posix_thread *tid_thread[TIDMAP_SIZE];
-static unsigned long tid_map[UK_BITS_TO_LONGS(TIDMAP_SIZE)];
+static unsigned long tid_map[UK_BITS_TO_LONGS(TIDMAP_SIZE)] = { [0] = 0x01UL };
/**
* Thread-local posix_thread reference