Skip to content

Commit 472a226

Browse files
committed
Add support for pthread_rwlock_clockrdlock(3) / pthread_rwlock_clockwrlock(3)
1 parent 02612d3 commit 472a226

File tree

16 files changed

+879
-18
lines changed

16 files changed

+879
-18
lines changed

kos/include/i386-kos/crt-features/crt-kos32.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,8 @@
13381338
#define __CRT_HAVE___pthread_once
13391339
#define __CRT_HAVE___pthread_register_cancel
13401340
#define __CRT_HAVE___pthread_register_cancel_defer
1341+
#define __CRT_HAVE___pthread_rwlock_clockrdlock64
1342+
#define __CRT_HAVE___pthread_rwlock_clockwrlock64
13411343
#define __CRT_HAVE___pthread_rwlock_destroy
13421344
#define __CRT_HAVE___pthread_rwlock_init
13431345
#define __CRT_HAVE___pthread_rwlock_rdlock
@@ -4760,6 +4762,10 @@
47604762
#define __CRT_HAVE_pthread_resume_all_np
47614763
#define __CRT_HAVE_pthread_resume_np
47624764
#define __CRT_HAVE_pthread_rpc_exec
4765+
#define __CRT_HAVE_pthread_rwlock_clockrdlock
4766+
#define __CRT_HAVE_pthread_rwlock_clockrdlock64
4767+
#define __CRT_HAVE_pthread_rwlock_clockwrlock
4768+
#define __CRT_HAVE_pthread_rwlock_clockwrlock64
47634769
#define __CRT_HAVE_pthread_rwlock_destroy
47644770
#define __CRT_HAVE_pthread_rwlock_init
47654771
#define __CRT_HAVE_pthread_rwlock_rdlock

kos/include/i386-kos/crt-features/crt-kos64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4436,6 +4436,8 @@
44364436
#define __CRT_HAVE_pthread_resume_all_np
44374437
#define __CRT_HAVE_pthread_resume_np
44384438
#define __CRT_HAVE_pthread_rpc_exec
4439+
#define __CRT_HAVE_pthread_rwlock_clockrdlock
4440+
#define __CRT_HAVE_pthread_rwlock_clockwrlock
44394441
#define __CRT_HAVE_pthread_rwlock_destroy
44404442
#define __CRT_HAVE_pthread_rwlock_init
44414443
#define __CRT_HAVE_pthread_rwlock_rdlock
@@ -10328,6 +10330,8 @@
1032810330
#define __CRT_HAVE_KOS$pthread_peekjoin_np
1032910331
#define __CRT_HAVE_KOS$pthread_resume2_np
1033010332
#define __CRT_HAVE_KOS$pthread_resume_np
10333+
#define __CRT_HAVE_KOS$pthread_rwlock_clockrdlock
10334+
#define __CRT_HAVE_KOS$pthread_rwlock_clockwrlock
1033110335
#define __CRT_HAVE_KOS$pthread_rwlock_destroy
1033210336
#define __CRT_HAVE_KOS$pthread_rwlock_init
1033310337
#define __CRT_HAVE_KOS$pthread_rwlock_rdlock
@@ -15209,6 +15213,8 @@
1520915213
#define __CRT_HAVE_DOS$pthread_peekjoin_np
1521015214
#define __CRT_HAVE_DOS$pthread_resume2_np
1521115215
#define __CRT_HAVE_DOS$pthread_resume_np
15216+
#define __CRT_HAVE_DOS$pthread_rwlock_clockrdlock
15217+
#define __CRT_HAVE_DOS$pthread_rwlock_clockwrlock
1521215218
#define __CRT_HAVE_DOS$pthread_rwlock_destroy
1521315219
#define __CRT_HAVE_DOS$pthread_rwlock_init
1521415220
#define __CRT_HAVE_DOS$pthread_rwlock_rdlock
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* HASH CRC-32:0xbfe4ec49 */
2+
/* Copyright (c) 2019-2025 Griefer@Work *
3+
* *
4+
* This software is provided 'as-is', without any express or implied *
5+
* warranty. In no event will the authors be held liable for any damages *
6+
* arising from the use of this software. *
7+
* *
8+
* Permission is granted to anyone to use this software for any purpose, *
9+
* including commercial applications, and to alter it and redistribute it *
10+
* freely, subject to the following restrictions: *
11+
* *
12+
* 1. The origin of this software must not be misrepresented; you must not *
13+
* claim that you wrote the original software. If you use this software *
14+
* in a product, an acknowledgement (see the following) in the product *
15+
* documentation is required: *
16+
* Portions Copyright (c) 2019-2025 Griefer@Work *
17+
* 2. Altered source versions must be plainly marked as such, and must not be *
18+
* misrepresented as being the original software. *
19+
* 3. This notice may not be removed or altered from any source distribution. *
20+
*/
21+
#ifndef __local_pthread_rwlock_clockrdlock_defined
22+
#define __local_pthread_rwlock_clockrdlock_defined
23+
#include <__crt.h>
24+
#include <bits/types.h>
25+
#if defined(__CRT_HAVE_pthread_rwlock_clockrdlock64) || defined(__CRT_HAVE___pthread_rwlock_clockrdlock64) || defined(__CRT_HAVE_pthread_rwlock_clockrdlock)
26+
#include <bits/crt/pthreadtypes.h>
27+
#include <bits/os/timespec.h>
28+
__NAMESPACE_LOCAL_BEGIN
29+
#if !defined(__local___localdep_crt_pthread_rwlock_clockrdlock32_defined) && defined(__CRT_HAVE_pthread_rwlock_clockrdlock)
30+
#define __local___localdep_crt_pthread_rwlock_clockrdlock32_defined
31+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_rwlock_clockrdlock32,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec32 const *__restrict __abstime),pthread_rwlock_clockrdlock,(__self,__clock_id,__abstime))
32+
#endif /* !__local___localdep_crt_pthread_rwlock_clockrdlock32_defined && __CRT_HAVE_pthread_rwlock_clockrdlock */
33+
#ifndef __local___localdep_pthread_rwlock_clockrdlock64_defined
34+
#define __local___localdep_pthread_rwlock_clockrdlock64_defined
35+
#if defined(__CRT_HAVE_pthread_rwlock_clockrdlock) && __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__
36+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockrdlock,(__self,__clock_id,__abstime))
37+
#elif defined(__CRT_HAVE_pthread_rwlock_clockrdlock64)
38+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockrdlock64,(__self,__clock_id,__abstime))
39+
#elif defined(__CRT_HAVE___pthread_rwlock_clockrdlock64)
40+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockrdlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),__pthread_rwlock_clockrdlock64,(__self,__clock_id,__abstime))
41+
#elif defined(__CRT_HAVE_pthread_rwlock_clockrdlock)
42+
__NAMESPACE_LOCAL_END
43+
#include <libc/local/pthread/pthread_rwlock_clockrdlock64.h>
44+
__NAMESPACE_LOCAL_BEGIN
45+
#define __localdep_pthread_rwlock_clockrdlock64 __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock64)
46+
#else /* ... */
47+
#undef __local___localdep_pthread_rwlock_clockrdlock64_defined
48+
#endif /* !... */
49+
#endif /* !__local___localdep_pthread_rwlock_clockrdlock64_defined */
50+
__LOCAL_LIBC(pthread_rwlock_clockrdlock) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t
51+
__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock))(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime) {
52+
#ifdef __CRT_HAVE_pthread_rwlock_clockrdlock
53+
__errno_t __result;
54+
struct __timespec32 __abstime32;
55+
__abstime32.tv_sec = (__time32_t)__abstime->tv_sec;
56+
__abstime32.tv_nsec = __abstime->tv_nsec;
57+
__result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_rwlock_clockrdlock32)(__self, __clock_id, &__abstime32);
58+
return __result;
59+
#else /* __CRT_HAVE_pthread_rwlock_clockrdlock */
60+
__errno_t __result;
61+
struct __timespec64 __abstime64;
62+
__abstime64.tv_sec = (__time64_t)__abstime->tv_sec;
63+
__abstime64.tv_nsec = __abstime->tv_nsec;
64+
__result = (__NAMESPACE_LOCAL_SYM __localdep_pthread_rwlock_clockrdlock64)(__self, __clock_id, &__abstime32);
65+
return __result;
66+
#endif /* !__CRT_HAVE_pthread_rwlock_clockrdlock */
67+
}
68+
__NAMESPACE_LOCAL_END
69+
#ifndef __local___localdep_pthread_rwlock_clockrdlock_defined
70+
#define __local___localdep_pthread_rwlock_clockrdlock_defined
71+
#define __localdep_pthread_rwlock_clockrdlock __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock)
72+
#endif /* !__local___localdep_pthread_rwlock_clockrdlock_defined */
73+
#else /* __CRT_HAVE_pthread_rwlock_clockrdlock64 || __CRT_HAVE___pthread_rwlock_clockrdlock64 || __CRT_HAVE_pthread_rwlock_clockrdlock */
74+
#undef __local_pthread_rwlock_clockrdlock_defined
75+
#endif /* !__CRT_HAVE_pthread_rwlock_clockrdlock64 && !__CRT_HAVE___pthread_rwlock_clockrdlock64 && !__CRT_HAVE_pthread_rwlock_clockrdlock */
76+
#endif /* !__local_pthread_rwlock_clockrdlock_defined */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* HASH CRC-32:0xea519647 */
2+
/* Copyright (c) 2019-2025 Griefer@Work *
3+
* *
4+
* This software is provided 'as-is', without any express or implied *
5+
* warranty. In no event will the authors be held liable for any damages *
6+
* arising from the use of this software. *
7+
* *
8+
* Permission is granted to anyone to use this software for any purpose, *
9+
* including commercial applications, and to alter it and redistribute it *
10+
* freely, subject to the following restrictions: *
11+
* *
12+
* 1. The origin of this software must not be misrepresented; you must not *
13+
* claim that you wrote the original software. If you use this software *
14+
* in a product, an acknowledgement (see the following) in the product *
15+
* documentation is required: *
16+
* Portions Copyright (c) 2019-2025 Griefer@Work *
17+
* 2. Altered source versions must be plainly marked as such, and must not be *
18+
* misrepresented as being the original software. *
19+
* 3. This notice may not be removed or altered from any source distribution. *
20+
*/
21+
#ifndef __local_pthread_rwlock_clockrdlock64_defined
22+
#define __local_pthread_rwlock_clockrdlock64_defined
23+
#include <__crt.h>
24+
#ifdef __CRT_HAVE_pthread_rwlock_clockrdlock
25+
#include <bits/types.h>
26+
#include <bits/crt/pthreadtypes.h>
27+
#include <bits/os/timespec.h>
28+
__NAMESPACE_LOCAL_BEGIN
29+
#ifndef __local___localdep_crt_pthread_rwlock_clockrdlock32_defined
30+
#define __local___localdep_crt_pthread_rwlock_clockrdlock32_defined
31+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_rwlock_clockrdlock32,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec32 const *__restrict __abstime),pthread_rwlock_clockrdlock,(__self,__clock_id,__abstime))
32+
#endif /* !__local___localdep_crt_pthread_rwlock_clockrdlock32_defined */
33+
__LOCAL_LIBC(pthread_rwlock_clockrdlock64) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t
34+
__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock64))(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime) {
35+
__errno_t __result;
36+
struct __timespec32 __abstime32;
37+
__abstime32.tv_sec = (__time32_t)__abstime->tv_sec;
38+
__abstime32.tv_nsec = __abstime->tv_nsec;
39+
__result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_rwlock_clockrdlock32)(__self, __clock_id, &__abstime32);
40+
return __result;
41+
}
42+
__NAMESPACE_LOCAL_END
43+
#ifndef __local___localdep_pthread_rwlock_clockrdlock64_defined
44+
#define __local___localdep_pthread_rwlock_clockrdlock64_defined
45+
#define __localdep_pthread_rwlock_clockrdlock64 __LIBC_LOCAL_NAME(pthread_rwlock_clockrdlock64)
46+
#endif /* !__local___localdep_pthread_rwlock_clockrdlock64_defined */
47+
#else /* __CRT_HAVE_pthread_rwlock_clockrdlock */
48+
#undef __local_pthread_rwlock_clockrdlock64_defined
49+
#endif /* !__CRT_HAVE_pthread_rwlock_clockrdlock */
50+
#endif /* !__local_pthread_rwlock_clockrdlock64_defined */
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* HASH CRC-32:0x984d8581 */
2+
/* Copyright (c) 2019-2025 Griefer@Work *
3+
* *
4+
* This software is provided 'as-is', without any express or implied *
5+
* warranty. In no event will the authors be held liable for any damages *
6+
* arising from the use of this software. *
7+
* *
8+
* Permission is granted to anyone to use this software for any purpose, *
9+
* including commercial applications, and to alter it and redistribute it *
10+
* freely, subject to the following restrictions: *
11+
* *
12+
* 1. The origin of this software must not be misrepresented; you must not *
13+
* claim that you wrote the original software. If you use this software *
14+
* in a product, an acknowledgement (see the following) in the product *
15+
* documentation is required: *
16+
* Portions Copyright (c) 2019-2025 Griefer@Work *
17+
* 2. Altered source versions must be plainly marked as such, and must not be *
18+
* misrepresented as being the original software. *
19+
* 3. This notice may not be removed or altered from any source distribution. *
20+
*/
21+
#ifndef __local_pthread_rwlock_clockwrlock_defined
22+
#define __local_pthread_rwlock_clockwrlock_defined
23+
#include <__crt.h>
24+
#include <bits/types.h>
25+
#if defined(__CRT_HAVE_pthread_rwlock_clockwrlock64) || defined(__CRT_HAVE___pthread_rwlock_clockwrlock64) || defined(__CRT_HAVE_pthread_rwlock_clockwrlock)
26+
#include <bits/crt/pthreadtypes.h>
27+
#include <bits/os/timespec.h>
28+
__NAMESPACE_LOCAL_BEGIN
29+
#if !defined(__local___localdep_crt_pthread_rwlock_clockwrlock32_defined) && defined(__CRT_HAVE_pthread_rwlock_clockwrlock)
30+
#define __local___localdep_crt_pthread_rwlock_clockwrlock32_defined
31+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_rwlock_clockwrlock32,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec32 const *__restrict __abstime),pthread_rwlock_clockwrlock,(__self,__clock_id,__abstime))
32+
#endif /* !__local___localdep_crt_pthread_rwlock_clockwrlock32_defined && __CRT_HAVE_pthread_rwlock_clockwrlock */
33+
#ifndef __local___localdep_pthread_rwlock_clockwrlock64_defined
34+
#define __local___localdep_pthread_rwlock_clockwrlock64_defined
35+
#if defined(__CRT_HAVE_pthread_rwlock_clockwrlock) && __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__
36+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockwrlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockwrlock,(__self,__clock_id,__abstime))
37+
#elif defined(__CRT_HAVE_pthread_rwlock_clockwrlock64)
38+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockwrlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_rwlock_clockwrlock64,(__self,__clock_id,__abstime))
39+
#elif defined(__CRT_HAVE___pthread_rwlock_clockwrlock64)
40+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_rwlock_clockwrlock64,(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),__pthread_rwlock_clockwrlock64,(__self,__clock_id,__abstime))
41+
#elif defined(__CRT_HAVE_pthread_rwlock_clockwrlock)
42+
__NAMESPACE_LOCAL_END
43+
#include <libc/local/pthread/pthread_rwlock_clockwrlock64.h>
44+
__NAMESPACE_LOCAL_BEGIN
45+
#define __localdep_pthread_rwlock_clockwrlock64 __LIBC_LOCAL_NAME(pthread_rwlock_clockwrlock64)
46+
#else /* ... */
47+
#undef __local___localdep_pthread_rwlock_clockwrlock64_defined
48+
#endif /* !... */
49+
#endif /* !__local___localdep_pthread_rwlock_clockwrlock64_defined */
50+
__LOCAL_LIBC(pthread_rwlock_clockwrlock) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t
51+
__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_rwlock_clockwrlock))(__pthread_rwlock_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime) {
52+
#ifdef __CRT_HAVE_pthread_rwlock_clockwrlock
53+
__errno_t __result;
54+
struct __timespec32 __abstime32;
55+
__abstime32.tv_sec = (__time32_t)__abstime->tv_sec;
56+
__abstime32.tv_nsec = __abstime->tv_nsec;
57+
__result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_rwlock_clockwrlock32)(__self, __clock_id, &__abstime32);
58+
return __result;
59+
#else /* __CRT_HAVE_pthread_rwlock_clockwrlock */
60+
__errno_t __result;
61+
struct __timespec64 __abstime64;
62+
__abstime64.tv_sec = (__time64_t)__abstime->tv_sec;
63+
__abstime64.tv_nsec = __abstime->tv_nsec;
64+
__result = (__NAMESPACE_LOCAL_SYM __localdep_pthread_rwlock_clockwrlock64)(__self, __clock_id, &__abstime32);
65+
return __result;
66+
#endif /* !__CRT_HAVE_pthread_rwlock_clockwrlock */
67+
}
68+
__NAMESPACE_LOCAL_END
69+
#ifndef __local___localdep_pthread_rwlock_clockwrlock_defined
70+
#define __local___localdep_pthread_rwlock_clockwrlock_defined
71+
#define __localdep_pthread_rwlock_clockwrlock __LIBC_LOCAL_NAME(pthread_rwlock_clockwrlock)
72+
#endif /* !__local___localdep_pthread_rwlock_clockwrlock_defined */
73+
#else /* __CRT_HAVE_pthread_rwlock_clockwrlock64 || __CRT_HAVE___pthread_rwlock_clockwrlock64 || __CRT_HAVE_pthread_rwlock_clockwrlock */
74+
#undef __local_pthread_rwlock_clockwrlock_defined
75+
#endif /* !__CRT_HAVE_pthread_rwlock_clockwrlock64 && !__CRT_HAVE___pthread_rwlock_clockwrlock64 && !__CRT_HAVE_pthread_rwlock_clockwrlock */
76+
#endif /* !__local_pthread_rwlock_clockwrlock_defined */

0 commit comments

Comments
 (0)