Lines Matching refs:clock
50 static struct pid *pid_for_clock(const clockid_t clock, bool gettime) in pid_for_clock() argument
52 const bool thread = !!CPUCLOCK_PERTHREAD(clock); in pid_for_clock()
53 const pid_t upid = CPUCLOCK_PID(clock); in pid_for_clock()
56 if (CPUCLOCK_WHICH(clock) >= CPUCLOCK_MAX) in pid_for_clock()
90 static inline int validate_clock_permissions(const clockid_t clock) in validate_clock_permissions() argument
95 ret = pid_for_clock(clock, false) ? 0 : -EINVAL; in validate_clock_permissions()
101 static inline enum pid_type clock_pid_type(const clockid_t clock) in clock_pid_type() argument
103 return CPUCLOCK_PERTHREAD(clock) ? PIDTYPE_PID : PIDTYPE_TGID; in clock_pid_type()
173 posix_cpu_clock_set(const clockid_t clock, const struct timespec64 *tp) in posix_cpu_clock_set() argument
175 int error = validate_clock_permissions(clock); in posix_cpu_clock_set()
352 static int posix_cpu_clock_get(const clockid_t clock, struct timespec64 *tp) in posix_cpu_clock_get() argument
354 const clockid_t clkid = CPUCLOCK_WHICH(clock); in posix_cpu_clock_get()
359 tsk = pid_task(pid_for_clock(clock, true), clock_pid_type(clock)); in posix_cpu_clock_get()
365 if (CPUCLOCK_PERTHREAD(clock)) in posix_cpu_clock_get()