libudev-queue.c revision 5f59fa0900a5c127ce1a25d8ba3176f166662f96
bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1Holger Hans Peter Freyther * libudev - interface to udev device information
bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1Holger Hans Peter Freyther * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1Holger Hans Peter Freyther * Copyright (C) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1Holger Hans Peter Freyther * This library is free software; you can redistribute it and/or
bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1Holger Hans Peter Freyther * modify it under the terms of the GNU Lesser General Public
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include <fcntl.h>
#include <limits.h>
#include "libudev.h"
#include "libudev-private.h"
struct udev_queue {
int refcount;
return NULL;
return NULL;
return udev_queue;
return NULL;
return udev_queue;
return NULL;
unsigned long long int seqnum;
int fd;
if (fd < 0)
return seqnum;
unsigned long long int seqnum;
return -EINVAL;
return seqnum;
unsigned short int len;
return len;
unsigned short int read_bytes = 0;
unsigned short int len;
return read_bytes;
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue->udev), "/.run/udev/queue.bin", NULL);
return NULL;
return NULL;
return queue_file;
unsigned long long int seqnum_udev;
unsigned long long int seqnum;
if (devpath_len < 0)
if (devpath_len > 0)
return seqnum_udev;
unsigned long long int seqnum_start;
unsigned long long int seqnum_kernel;
unsigned long long int seqnum_udev = 0;
int queued = 0;
int is_empty = 0;
return -EINVAL;
unsigned long long int seqnum;
if (devpath_len < 0)
if (devpath_len > 0) {
queued++;
queued--;
if (queued > 0) {
goto out;
goto out;
out:
return is_empty;
unsigned long long int seqnum;
int unfinished;
return -EINVAL;
return -EOVERFLOW;
if (devpath_len < 0)
unfinished++;
if (devpath_len == 0) {
unfinished--;
} while (unfinished > 0);
return (unfinished == 0);
unsigned long long int seqnum;
return NULL;
return NULL;
size_t l;
s = syspath;
if (len < 0)
if (len > 0) {
return NULL;
return NULL;
size_t l;
s = syspath;