sysctl.c revision d3b6d0c21ea5a0d15ec6dbd8b8d179138b7463bc
566f735e84e576e1592d0bf367182a0586944380Robert Wapshott/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
566f735e84e576e1592d0bf367182a0586944380Robert Wapshott This file is part of systemd.
along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <getopt.h>
#include "log.h"
#include "strv.h"
#include "util.h"
#include "strv.h"
#include "hashmap.h"
#include "path-util.h"
#include "conf-files.h"
#include "fileio.h"
static const char conf_file_dirs[] =
#ifdef HAVE_SPLIT_USR
static char *normalize_sysctl(char *s) {
return log_oom();
bool good = false;
if (path_startswith(p, *i)) {
good = true;
if (!good) {
if (k != -ENOENT && r == 0)
Iterator i;
while (!feof(f)) {
if (!fgets(l, sizeof(l), f)) {
if (feof(f))
return -errno;
p = strstrip(l);
if (!value) {
r = -EINVAL;
*value = 0;
value++;
if (existing) {
p, path);
if (!property)
return log_oom();
if (!new_value) {
return log_oom();
static int help(void) {
help();
case ARG_PREFIX: {
for (p = optarg; *p; p++)
return log_oom();
arg_prefixes = l;
return -EINVAL;
return -EINVAL;
log_open();
if (!sysctl_options) {
r = log_oom();
goto finish;
goto finish;