process-util: introduce proc_get_timerslack()

This commit is contained in:
Lennart Poettering
2026-07-13 15:39:17 +02:00
parent 3ac3632e28
commit 4d84f8fac3
4 changed files with 14 additions and 5 deletions
+10
View File
@@ -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;
}
+1
View File
@@ -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);