monitor.c revision 31c53c2e1afc6c81ce4aad5ef4cb982cd2fea365
/*
* 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 "error.h"
#include "af_unix.h"
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
{
char path[MAXPATHLEN];
nfd = inotify_init();
if (nfd < 0) {
SYSERROR("failed to initialize inotify");
return -1;
}
if (wfd < 0) {
goto out;
}
for(;;) {
struct inotify_event evt;
SYSERROR("failed to read inotify event");
goto out;
}
if (state < 0) {
ERROR("failed to get the state for %s",
name);
goto out;
}
SYSERROR("failed to send state to %d",
goto out;
}
continue;
}
err = 0;
goto out;
}
goto out;
}
out:
return err;
}
{
int fd;
if (fd < 0)
return;
}
{
}
int lxc_monitor_open(void)
{
int fd;
if (fd < 0)
return -1;
return -1;
}
return fd;
}
{
struct sockaddr_un from;
int ret;
if (ret < 0) {
SYSERROR("failed to receive state");
return -LXC_ERROR_INTERNAL;
}
return ret;
}
int lxc_monitor_close(int fd)
{
}