Hello, I've got a question about libudev, concerning the function "udev_queue_get_seqnum_is_finished()". According to the documentation, it returns a flag, indicating whether the given sequence number has already been processed. In my experiments however, I found this function to always return 1, even for sequence numbers which haven't ocurred yet. The attached test program gives the following output on my system: $ ./udev_queue_sequence_numbers current seqnum: 1662 is previous seqnum finished? yes is current seqnum finished? yes is next seqnum finished? yes In my understanding, the last line should have said "no", because the number immediately folllowing the current sequence number has obviously not yet occurred. Am I missing something? Thanks for your help, Sebastian Wiesner
#include <libudev.h> #include <stdio.h> #include <assert.h> int main(int argc, char *argv[]) { struct udev *context = udev_new(); assert(context); struct udev_queue *queue = udev_queue_new(context); assert(queue); unsigned long long int current_seqnum = udev_queue_get_udev_seqnum(queue); int is_current_finished = udev_queue_get_seqnum_is_finished( queue, current_seqnum); int is_previous_finished = udev_queue_get_seqnum_is_finished( queue, current_seqnum - 1l); int is_next_finished = udev_queue_get_seqnum_is_finished( queue, current_seqnum + 1l); printf("current seqnum: %llu\n", current_seqnum); printf("is previous seqnum finished? %s\n", is_previous_finished? "yes": "no"); printf("is current seqnum finished? %s\n", is_current_finished? "yes": "no"); printf("is next seqnum finished? %s\n", is_next_finished? "yes": "no"); return 0; }