]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/nolibc: Import `pthread_t` & `pthread_attr_t` from musl
authorMichalis Pappas <michalis@unikraft.io>
Fri, 5 Jan 2024 18:42:47 +0000 (19:42 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Mon, 17 Feb 2025 14:46:09 +0000 (14:46 +0000)
Import definitions of `pthread_d` and `pthread_addr_t`
from musl, with minor changes to adapt for nolibc's
`sharedefs.h`.

Source of import:
Repository: https://git.musl-libc.org/cgit/musl
Tag: v1.2.4 (f5f55d65)
Path: musl/include/alltypes.h.in

Checkpatch-Ignore: POINTER_LOCATION
Checkpatch-Ignore: LONG_LINES
Checkpatch-Ignore: VOLATILE
Checkpatch-Ignore: SPACING
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1244

lib/nolibc/include/nolibc-internal/shareddefs.h

index 53b0651fe0b25b0880b4436d8c6b0c83c12a56c0..57aeeefc97472907c0d780360c529a933d8ca8b0 100644 (file)
@@ -225,3 +225,17 @@ typedef unsigned int u_int;
 typedef unsigned long u_long;
 #define __DEFINED_BSD_TYPES
 #endif
+
+#if (defined __NEED_pthread_t && !defined __DEFINED_pthread_t)
+#ifdef __cplusplus
+typedef unsigned long pthread_t;
+#else
+typedef struct __pthread * pthread_t;
+#endif
+#define __DEFINED_pthread_t
+#endif
+
+#if (defined __NEED_pthread_attr_t && !defined __DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif