CLOCK_GETCPUCLOCKID(3P)
πΈ CLOCK_GETCPUCLOCKID(3P) β POSIX Programmer's Manual πΈ
okay so bestie, this is clock_getcpuclockid from the POSIX Programmer's Manual, and I need you to know it's lowkey one of the cutest little functions ever. it hands you the clock ID of a process's CPU-time clock. that's it. that's the whole job. and she does it flawlessly π
β¨ PROLOG β¨
so this manual page? it's part of the POSIX Programmer's Manual. that means it describes the POSIX interface, not necessarily what Linux does.
heads up bestie: the Linux implementation of this interface may differ β so if you're on Linux, go consult the corresponding Linux manual page for the details of Linux behavior. π
and likeβ¦ it's also possible the interface is not implemented on Linux at all. no cap. so vibe check your platform first, okay? π
π NAME π
clock_getcpuclockid β access a process CPU-time clock (ADVANCED REALTIME)
π¦ SYNOPSIS π¦
#include <time.h>
int clock_getcpuclockid(pid_t pid, clockid_t *clock_id);
π DESCRIPTION π
okay so here's the tea. the clock_getcpuclockid() function shall return the clock ID of the CPU-time clock of the process specified by pid. π«Ά
if the process described by pid exists and the calling process has permission, then the clock ID of this clock shall be returned in clock_id. iconic behaviour, honestly.
and if pid is zero? slay. the clock_getcpuclockid() function shall return the clock ID of the CPU-time clock of the process making the call, in clock_id. it's giving "look at me, I'm the main character" energy and I respect it. β¨
now, the conditions under which one process has permission to obtain the CPU-time clock ID of other processes? those are implementation-defined. so like, don't @ me, ask your implementation. iykyk. π
π₯ RETURN VALUE π₯
upon successful completion, clock_getcpuclockid() shall return zero. π
otherwise, an error number shall be returned to indicate the error. not the vibe, but okay, we move. π
π ERRORS π
the clock_getcpuclockid() function shall fail if:
EPERMβ the requesting process does not have permission to access the CPU-time clock for the process. permission denied bestie, sorry π«
the clock_getcpuclockid() function may fail if:
ESRCHβ no process can be found corresponding to the process specified bypid. she's not there. she never was. π
also, for the record: the following sections are informative. like, that's a whole status. informative. not normative. keep that in mind. π
πΈ EXAMPLES πΈ
None.
that's the entire section. no examples. she said "figure it out, bestie." π
π APPLICATION USAGE π
the clock_getcpuclockid() function is part of the Process CPU-Time Clocks option, and it need not be provided on all implementations. so like β not every platform ships her. check before you get attached. π₯²
π RATIONALE π
None.
nothing. empty. the silence is loud. π€
β FUTURE DIRECTIONS β
None.
she's not going anywhere, and apparently neither is this section. ποΈ
π SEE ALSO π
clock_getres()timer_create()- The Base Definitions volume of POSIX.1β2017,
<time.h>
π COPYRIGHT π
okay this part is the legal bit so I'm keeping it exactly as she comes, because we do not paraphrase lawyers, bestie. here it is:
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 .
and also:
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 .
so yeah. referee document. that's the ruling. π§ββοΈβ¨
and that's the whole page!! mwah π courtesy of IEEE/The Open Group, 2017 β that's the source, the version, and the date all rolled into one, and this was CLOCK_GETCPUCLOCKID(3P) from the POSIX Programmer's Manual. go get that CPU-time clock ID, queen ππ¦π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms