process-util: introduce proc_get_timerslack()
This commit is contained in:
@@ -2296,3 +2296,13 @@ int proc_set_comm(const char *comm) {
|
||||
int proc_set_nnp(void) {
|
||||
return prctl_safe(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||
}
|
||||
|
||||
nsec_t proc_get_timerslack(void) {
|
||||
int r;
|
||||
|
||||
r = prctl_safe(PR_GET_TIMERSLACK, 0, 0, 0, 0);
|
||||
if (r < 0)
|
||||
return NSEC_INFINITY;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -260,3 +260,4 @@ int prctl_safe(int op, unsigned long arg2, unsigned long arg3, unsigned long arg
|
||||
|
||||
int proc_set_comm(const char *comm);
|
||||
int proc_set_nnp(void);
|
||||
nsec_t proc_get_timerslack(void);
|
||||
|
||||
Reference in New Issue
Block a user