libudev-monitor.c revision ba6929f6690a72485ac3c6b7610ffbd5ab319be7
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include "libudev.h"
#include "libudev-private.h"
#include "../udev.h"
struct udev_monitor {
int refcount;
int socket;
};
{
struct udev_monitor *udev_monitor;
struct sockaddr_un saddr;
const int on = 1;
return NULL;
if (socket_path == NULL)
return NULL;
if (udev_monitor == NULL)
return NULL;
/* translate leading '@' to abstract namespace */
return NULL;
}
return NULL;
}
/* enable receiving of the sender credentials */
return udev_monitor;
}
{
if (udev_monitor == NULL)
return NULL;
udev_monitor->refcount++;
return udev_monitor;
}
{
if (udev_monitor == NULL)
return;
udev_monitor->refcount--;
if (udev_monitor->refcount > 0)
return;
}
{
if (udev_monitor == NULL)
return NULL;
return udev_monitor->udev;
}
{
if (udev_monitor == NULL)
return -1;
return udev_monitor->socket;
}
{
struct udev_device *udev_device;
char buf[4096];
if (udev_monitor == NULL)
return NULL;
return NULL;
}
return NULL;
}
return NULL;
}
/* skip header */
return NULL;
}
/* check message header */
return NULL;
}
if (udev_device == NULL) {
return NULL;
}
char *key;
if (keylen == 0)
break;
next[0] = '\0';
}
if (slink[0] != '\0')
}
}
return udev_device;
}