*getsockopt*, of all things?
Posted Jul 2, 2009 16:39 UTC (Thu) by quotemstr
In reply to: *getsockopt*, of all things?
Parent article: The fanotify API
Normal IO isn't sufficient because we need to send a file descriptor over the socket. I think the original author decided to go with a new socket family because there's no way to send a file descriptor over an AF_NETLINK socket.
Speaking of which, AF_NETLINK seems to be exactly what's needed here, just extended to support sending file descriptors over ancillary messages.
Of course, the other option is to just create a device node and use
ioctl. That's frowned upon, but what harm does it really do? Plus, using a device node allows you to restrict access to the device using all the usual UNIX-permission-and-POSIX-ACL goodness available anywhere else.
to post comments)