POSIX: add pthread_getcpuclockid()

fix #15615

Change-Id: I6b34f97464fac97d0b339fa338cfc5df34536080
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8681
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2024-12-17 09:45:13 +00:00
parent 1ad6193d82
commit 04c90835ac
8 changed files with 153 additions and 13 deletions
+1
View File
@@ -196,6 +196,7 @@ extern int pthread_atfork(void (*prepare)(void), void (*parent)(void),
void (*child)(void));
extern int pthread_once(pthread_once_t *once_control,
void (*init_routine)(void));
extern int pthread_getcpuclockid(pthread_t thread_id, clockid_t* clock_id);
/* thread attributes functions */
extern int pthread_attr_destroy(pthread_attr_t *attr);
+1
View File
@@ -261,6 +261,7 @@ void user_timer_check_team_user_timers(Team* team);
status_t _user_get_clock(clockid_t clockID, bigtime_t* _time);
status_t _user_set_clock(clockid_t clockID, bigtime_t time);
status_t _user_get_cpuclockid(thread_id id, int32 which, clockid_t* _clockID);
int32 _user_create_timer(clockid_t clockID, thread_id threadID,
uint32 flags, const struct sigevent* event,
@@ -0,0 +1,15 @@
/*
* Copyright 2024, Jérôme Duval, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYSTEM_SYSCALL_CLOCK_INFO_H
#define _SYSTEM_SYSCALL_CLOCK_INFO_H
enum which_process_info {
TEAM_ID = 1,
THREAD_ID,
};
#endif /* _SYSTEM_SYSCALL_CLOCK_INFO_H */
+1
View File
@@ -412,6 +412,7 @@ extern status_t _kern_get_real_time_clock_is_gmt(bool *_isGMT);
extern status_t _kern_get_clock(clockid_t clockID, bigtime_t* _time);
extern status_t _kern_set_clock(clockid_t clockID, bigtime_t time);
extern status_t _kern_get_cpuclockid(thread_id id, int32 which, clockid_t* _clockID);
extern bigtime_t _kern_system_time();
extern status_t _kern_snooze_etc(bigtime_t time, int timebase, int32 flags,