Mercurial > archived > louis > perso > liblxcstats
view 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 |
line wrap: on
line source
#include <sys/types.h> #include <err.h> #include <stdio.h> #include <stdlib.h> #include "lxcstats.h" #include "_lxcstats.h" int main(int argc, char *argv[]) { lxcst_handle *hdl; int count; hdl = lxcst_open(); if (!hdl) err(EXIT_FAILURE, "lxcst_open failed"); count = _lxcst_container_count(hdl); if (count == -1) err(EXIT_FAILURE, "_lxcst_container_count failed"); printf("%s: %d containers.\n", *argv, count); lxcst_close(hdl); return (EXIT_SUCCESS); (void)argc; }