Prashanth Reddy D
Prashanth Reddy D

Reputation: 21

Obtaining the per-process CPU-time clock of another process in Linux kernel

How to check whether linux kernel support obtaining the per-process CPU-time clock of another process?

In Detail :

clock_getcpuclockid() returns EPERM error if The caller does not have permission to access the CPU-time clock of the process specified by pid. (Specified as an optional error in POSIX.1-2001; does not occur on Linux unless the kernel does not support obtaining the per-process CPU-time clock of another process.)

So, my question is how to check whether linux kernel support obtaining the per-process CPU-time clock of another process? In other words how can I make clock_getcpuclockid() to fail with return value EPERM?

Upvotes: 0

Views: 302

Answers (1)

CL.
CL.

Reputation: 180280

The Linux kernel supports this if clock_getcpuclockid() succeeds.

Upvotes: 1

Related Questions