rlimit-util.h revision 99d4f5e5c0d2532159542519e683f976f881f0f5
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering#pragma once
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering/***
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering This file is part of systemd.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering Copyright 2010 Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering (at your option) any later version.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering systemd is distributed in the hope that it will be useful, but
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering Lesser General Public License for more details.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering***/
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering#include <sys/resource.h>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering#include "macro.h"
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poetteringconst char *rlimit_to_string(int i) _const_;
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poetteringint rlimit_from_string(const char *s) _pure_;
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poetteringint setrlimit_closest(int resource, const struct rlimit *rlim);
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poetteringint rlimit_parse_one(int resource, const char *val, rlim_t *ret);
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poetteringint rlimit_parse(int resource, const char *val, struct rlimit *ret);
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poetteringint rlimit_format(const struct rlimit *rl, char **ret);
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })