comparison tests/container_count.c @ 7:8339ab15527d

Add running/stopped containers global statistics and refactor some things
author Louis Opter <louis@dotcloud.com>
date Sat, 01 Jan 2011 17:46:40 +0100
parents
children
comparison
equal deleted inserted replaced
6:e2b88f50e136 7:8339ab15527d
1 #include <sys/types.h>
2
3 #include <err.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6
7 #include "lxcstats.h"
8 #include "_lxcstats.h"
9
10 int
11 main(int argc, char *argv[])
12 {
13 lxcst_handle *hdl;
14 int count;
15
16 hdl = lxcst_open();
17 if (!hdl)
18 err(EXIT_FAILURE, "lxcst_open failed");
19
20 count = _lxcst_container_count(hdl);
21 if (count == -1)
22 err(EXIT_FAILURE, "_lxcst_container_count failed");
23
24 printf("%s: %d containers.\n", *argv, count);
25
26 lxcst_close(hdl);
27
28 return (EXIT_SUCCESS);
29 (void)argc;
30 }