1
0
Fork 0
alistair23-linux/include
Eric Paris a1014f1023 fanotify: send events using read
Send events to userspace by reading the file descriptor from fanotify_init().
One will get blocks of data which look like:

struct fanotify_event_metadata {
	__u32 event_len;
	__u32 vers;
	__s32 fd;
	__u64 mask;
	__s64 pid;
	__u64 cookie;
} __attribute__ ((packed));

Simple code to retrieve and deal with events is below

	while ((len = read(fan_fd, buf, sizeof(buf))) > 0) {
		struct fanotify_event_metadata *metadata;

		metadata = (void *)buf;
		while(FAN_EVENT_OK(metadata, len)) {
			[PROCESS HERE!!]
			if (metadata->fd >= 0 && close(metadata->fd) != 0)
				goto fail;
			metadata = FAN_EVENT_NEXT(metadata, len);
		}
	}

Signed-off-by: Eric Paris <eparis@redhat.com>
2010-07-28 09:58:56 -04:00
..
acpi ACPI: skip checking BM_STS if the BIOS doesn't ask for it 2010-07-22 16:54:27 -04:00
asm-generic fanotify: FMODE_NONOTIFY and __O_SYNC in sparc conflict 2010-07-28 09:58:54 -04:00
crypto crypto: skcipher - Add ablkcipher_walk interfaces 2010-05-19 14:13:07 +10:00
drm drm/ttm: Allocate the page pool manager in the heap. 2010-07-07 12:14:11 +10:00
keys
linux fanotify: send events using read 2010-07-28 09:58:56 -04:00
math-emu math-emu: correct test for downshifting fraction in _FP_FROM_INT() 2010-07-20 18:45:14 -07:00
media V4L/DVB: tuner: Add a definition for the Philips FQ1236 MK5 NTSC tuner 2010-07-08 16:49:53 -03:00
mtd
net net sched: fix race in mirred device removal 2010-07-24 21:04:20 -07:00
pcmcia pcmcia: remove unused mem_op.h 2010-05-10 10:23:20 +02:00
rdma IB/core: Allow device-specific per-port sysfs files 2010-05-21 10:34:44 -07:00
rxrpc
scsi SCSI: implement sd_unlock_native_capacity() 2010-06-02 13:50:04 -04:00
sound Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-05-20 09:41:44 -07:00
trace Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-06-10 09:30:09 -07:00
video fbdev: move FBIO_WAITFORVSYNC to linux/fb.h 2010-05-25 08:07:09 -07:00
xen
Kbuild