LibPthread: Implement pthread_condattr_getclock

I noticed this was missing while adding spec comments a bit ago.
It's small and easy enough to implement, might as well make us
more POSIX compliant.
This commit is contained in:
Brian Gianforcaro 2022-01-08 19:56:52 -08:00 committed by Ali Mohammad Pur
commit 84962fcc9b
Notes: sideshowbarker 2024-07-17 21:21:22 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -29,6 +29,13 @@ int pthread_condattr_destroy(pthread_condattr_t*)
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_condattr_getclock.html
int pthread_condattr_getclock(pthread_condattr_t* attr, clockid_t* clock)
{
*clock = attr->clockid;
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_condattr_setclock.html
int pthread_condattr_setclock(pthread_condattr_t* attr, clockid_t clock)
{