monitor.c revision c2cc9f0a9b052563d803d3d1e685e307d1d1412b
/*
* lxc: linux Container library
*
* (C) Copyright IBM Corp. 2007, 2008
*
* Authors:
* Daniel Lezcano <dlezcano at fr.ibm.com>
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <lxc.h>
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
{
char path[MAXPATHLEN];
nfd = inotify_init();
if (nfd < 0) {
lxc_log_syserror("failed to initialize inotify");
return -1;
}
if (wfd < 0) {
goto out;
}
for(;;) {
struct inotify_event evt;
lxc_log_syserror("failed to read inotify event");
goto out;
}
if (state < 0) {
lxc_log_error("failed to get the state for %s",
name);
goto out;
}
lxc_log_syserror("failed to send state to %d",
goto out;
}
continue;
}
err = 0;
goto out;
}
goto out;
}
out:
return err;
}
{
int fd;
struct sockaddr_un addr;
if (fd < 0)
lxc_log_syserror("failed to create notification socket");
}
void lxc_monitor_cleanup(const char *name)
{
char path[UNIX_PATH_MAX];
}
int lxc_monitor_open(const char *name)
{
int fd;
struct sockaddr_un addr;
if (fd < 0) {
lxc_log_syserror("failed to create notification socket");
return -1;
}
return -1;
}
return fd;
}
{
int ret;
if (ret < 0) {
lxc_log_syserror("failed to received state");
return -1;
}
return ret;
}
int lxc_monitor_close(int fd)
{
}