1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include <sys/types.h>
7 
8 #define AUDIT_SESSION_INVALID UINT32_MAX
9 
10 int audit_session_from_pid(pid_t pid, uint32_t *id);
11 int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
12 
13 bool use_audit(void);
14 
audit_session_is_valid(uint32_t id)15 static inline bool audit_session_is_valid(uint32_t id) {
16         return id > 0 && id != AUDIT_SESSION_INVALID;
17 }
18