diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-18 12:25:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-18 12:25:20 -0400 |
commit | 3c8a9043b6fc8fafbeac16e8f9199a0d12870549 (patch) | |
tree | d3efa261e61f19b3aea254409cb2c144886f5d05 /Utility/libkqueue.c | |
parent | 0ecc7dc8927b3840d6a7ba4d39c344f3e962580e (diff) |
skeleton C library for calling kqueue
Diffstat (limited to 'Utility/libkqueue.c')
-rw-r--r-- | Utility/libkqueue.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Utility/libkqueue.c b/Utility/libkqueue.c new file mode 100644 index 000000000..0ef42b801 --- /dev/null +++ b/Utility/libkqueue.c @@ -0,0 +1,22 @@ +/* kqueue interface, C mini-library + * + * Copyright 2012 Joey Hess <joey@kitenet.net> + * + * Licensed under the GNU GPL version 3 or higher. + */ + +#include <errno.h> +#include <stdio.h> + +/* Waits for a change event on one of the array of directory fds, + * and returns the one that changed. */ +int waitchange(const int *fds) { +// if (kqueue(blah, &fds) != 0) +// return 0; /* errno is set */ +// else + errno = 0; + + printf("in waitchange!, %i %i\n", fds[0], fds[1]); + + return fds[0]; +} |