]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/rlimit-util.h
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / basic / rlimit-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2010 Lennart Poettering
8 ***/
9
10 #include <sys/resource.h>
11
12 #include "macro.h"
13
14 const char *rlimit_to_string(int i) _const_;
15 int rlimit_from_string(const char *s) _pure_;
16
17 int setrlimit_closest(int resource, const struct rlimit *rlim);
18
19 int rlimit_parse_one(int resource, const char *val, rlim_t *ret);
20 int rlimit_parse(int resource, const char *val, struct rlimit *ret);
21
22 int rlimit_format(const struct rlimit *rl, char **ret);
23
24 #define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })