3
* Copyright IBM Corporation. 2007
5
* Authors: Dhaval Giani <dhaval@linux.vnet.ibm.com>
6
* Balbir Singh <balbir@linux.vnet.ibm.com>
8
* This program is free software; you can redistribute it and/or modify it
9
* under the terms of version 2.1 of the GNU Lesser General Public License
10
* as published by the Free Software Foundation.
12
* This program is distributed in the hope that it would be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
* Code initiated and designed by Dhaval Giani. All faults are most likely
20
#include <libcgroup.h>
21
#include <libcgroup-internal.h>
29
static void usage(char *progname)
31
printf("Usage: %s [OPTION] [FILE]\n", basename(progname));
32
printf("Parse and load the specified cgroups configuration file\n");
34
printf(" -h, --help Display this help\n");
35
printf(" -l, --load=FILE Parse and load the cgroups configuration file\n");
39
int main(int argc, char *argv[])
42
char filename[PATH_MAX];
44
static struct option options[] = {
51
usage(argv[0]); /* usage() exits */
53
while ((c = getopt_long(argc, argv, "hl:", options, NULL)) > 0) {
59
strncpy(filename, optarg, PATH_MAX);
60
ret = cgroup_config_load_config(filename);
62
printf("Loading configuration file %s "
63
"failed\n%s\n", filename,
64
cgroup_strerror(ret));