Back to index

glibc  2.9
Functions
clock_getcpuclockid.c File Reference
#include <errno.h>
#include <time.h>
#include <unistd.h>

Go to the source code of this file.

Functions

int clock_getcpuclockid (pid_t pid, clockid_t *clock_id)

Function Documentation

int clock_getcpuclockid ( pid_t  pid,
clockid_t *  clock_id 
)

Definition at line 24 of file clock_getcpuclockid.c.

{
  /* We don't allow any process ID but our own.  */
  if (pid != 0 && pid != getpid ())
    return EPERM;

#ifdef CLOCK_PROCESS_CPUTIME_ID
  /* Store the number.  */
  *clock_id = CLOCK_PROCESS_CPUTIME_ID;

  return 0;
#else
  /* We don't have a timer for that.  */
  return ENOENT;
#endif
}

Here is the call graph for this function: