Lines Matching refs:clock
57 static struct pid *pid_for_clock(const clockid_t clock, bool gettime) in pid_for_clock() argument
59 const bool thread = !!CPUCLOCK_PERTHREAD(clock); in pid_for_clock()
60 const pid_t upid = CPUCLOCK_PID(clock); in pid_for_clock()
63 if (CPUCLOCK_WHICH(clock) >= CPUCLOCK_MAX) in pid_for_clock()
97 static inline int validate_clock_permissions(const clockid_t clock) in validate_clock_permissions() argument
102 ret = pid_for_clock(clock, false) ? 0 : -EINVAL; in validate_clock_permissions()
108 static inline enum pid_type clock_pid_type(const clockid_t clock) in clock_pid_type() argument
110 return CPUCLOCK_PERTHREAD(clock) ? PIDTYPE_PID : PIDTYPE_TGID; in clock_pid_type()
180 posix_cpu_clock_set(const clockid_t clock, const struct timespec64 *tp) in posix_cpu_clock_set() argument
182 int error = validate_clock_permissions(clock); in posix_cpu_clock_set()
359 static int posix_cpu_clock_get(const clockid_t clock, struct timespec64 *tp) in posix_cpu_clock_get() argument
361 const clockid_t clkid = CPUCLOCK_WHICH(clock); in posix_cpu_clock_get()
366 tsk = pid_task(pid_for_clock(clock, true), clock_pid_type(clock)); in posix_cpu_clock_get()
372 if (CPUCLOCK_PERTHREAD(clock)) in posix_cpu_clock_get()