| CLOCK_GETCPUCLOCKID2(2) | System Calls Manual | CLOCK_GETCPUCLOCKID2(2) | 
clock_getcpuclockid2,
  clock_getcpuclockid —
#include <time.h>
int
  
  clock_getcpuclockid2(idtype_t
    idtype, id_t id,
    clockid_t *clock_id);
int
  
  clock_getcpuclockid(pid_t
    pid, clockid_t
    *clock_id);
cpu_getcpuclockid2() function retrieves the
  clock_id for the CPU-time clock of the specified
  id and idtype. Supported
  idtypes are:
P_PID0 for the current
      process.P_LWPID0 for the current
    LWP.The clock_getcpuclockid() function is
    equivalent to calling clock_getcpuclockid2() with
    idtype P_PID and
    id pid.
The clock_gettime(2) function can be used with the returned clock_id to retrieve process and LWP CPU usage times.
clock_getcpuclockid2() function returns the
  value 0 if successful; otherwise the value -1 is returned and
  the global variable errno is set to indicate the error.
If successful, the clock_getcpuclockid()
    function will return 0. Otherwise an error number will be returned.
EFAULT]In addition clock_getcpuclockid2() will
    fail if:
EINVAL]clock_getcpuclockid() function conforms to
  IEEE Std 1003.1-2001 (“POSIX.1”). The
  clock_getcpuclockid2() is a
  NetBSD extension.
clock_getcpuclockid() and
  clock_getcpuclockid2() functions appeared in
  NetBSD 8.
| June 24, 2018 | NetBSD 9.3 |