Accesses a process CPU-time clock.
The clock_getcpuclockid subroutine returns 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, the clock ID of this clock returns in clock_id.
If pid is zero, the clock_getcpuclockid subroutine returns the clock ID specified in clock_id of the CPU-time clock of the process making the call.
To obtain the CPU-time clock ID of other processes, the calling process should be root or have the same effective or real user ID as the process that owns the targetted CPU-time clock.
Item | Description |
---|---|
clock_id | Specifies the clock ID of the CPU-time clock. |
pid | Specifies the process ID of the CPU-time clock. |
Upon successful completion, the clock_getcpuclockid subroutine returns 0; otherwise, an error code is returned indicating the error.
Item | Description |
---|---|
ENOTSUP | The function is not supported with checkpoint-restart processes. |
EPERM | The requesting process does not have permission to access the CPU-time clock for the process. |
ESRCH | No process can be found corresponding to the process specified by pid. |