PTHREAD...UCLOCKID(3POSIX)
π PROLOG π
okay bestie, before we even get into it β heads up that this page is part of the POSIX Programmer's Manual π. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior π), or honestly the interface might not even be implemented on Linux at all. no cap.
β¨ NAME β¨
pthread_getcpuclockid β access a thread CPU-time clock (ADVANCED REALTIME THREADS) π°οΈπ
π SYNOPSIS π
#include <pthread.h>
#include <time.h>
int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id);
π¦ DESCRIPTION π¦
so basically, the pthread_getcpuclockid() function shall return in clock_id the clock ID of the CPU-time clock of the thread specified by thread_id β if the thread specified by thread_id exists. that's the whole vibe. it's giving "give me the clock id of this specific thread's cpu-time clock" and honestly? iconic. β
π RETURN VALUE π
upon successful completion, pthread_getcpuclockid() shall return zero π«Ά. otherwise, an error number shall be returned to indicate the error. so like, zero = slay, anything else = the error number, periodt.
π ERRORS π
no errors are defined. literally none. the list is empty, bestie π
the following sections are informative. (iykyk β that means they're the bonus lore, not the actual spec rules β¨)
π EXAMPLES π
None. yeah. no examples. we're on our own out here π
π§ APPLICATION USAGE π§
important one!! the pthread_getcpuclockid() function is part of the Thread CPU-Time Clocks option and need not be provided on all implementations πΈ. so don't be shocked if your platform is like "never heard of her" π
π RATIONALE π
if an implementation detects use of a thread ID after the end of its lifetime, it is recommended that the function should fail and report an [ESRCH] error. like β using a thread id after it's dead? that's the ghost of a thread, bestie, and the rec is to fail with [ESRCH] and report it π»
β FUTURE DIRECTIONS β
None. the future is... nothing. no notes. moving on π¦
π SEE ALSO π
clock_getcpuclockid()clock_getres()timer_create()
and also, from the Base Definitions volume of POSIX.1β2017: <pthread.h>, <time.h> πβ¨
π COPYRIGHT π
portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document π. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format π. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole page bestie, you ate it π
β¨ β shoutout to IEEE/The Open Group, 2017, and the page PTHREAD...UCLOCKID(3POSIX) for the lore π«Άπ
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms