]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/securebits-util.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / shared / securebits-util.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
07d46372
YW
2#pragma once
3
3843e826 4#include "missing_securebits.h"
07d46372
YW
5
6int secure_bits_to_string_alloc(int i, char **s);
7int secure_bits_from_string(const char *s);
33d12153 8
07d46372
YW
9static inline bool secure_bits_is_valid(int i) {
10 return ((SECURE_ALL_BITS | SECURE_ALL_LOCKS) & i) == i;
11}
33d12153
YW
12
13static inline int secure_bits_to_string_alloc_with_check(int n, char **s) {
14 if (!secure_bits_is_valid(n))
15 return -EINVAL;
16
17 return secure_bits_to_string_alloc(n, s);
18}