Re: [patch 7/8] fdmap v2 - implement sys_socket2

From: Linus Torvalds
Date: Sun Jun 10 2007 - 13:25:34 EST




On Sun, 10 Jun 2007, Al Viro wrote:
>
> On FreeBSD it will simply give you zero st_ino on almost all sockets;
> AF_UNIX ones get st_ino invented (and stable). st_dev is NODEV in all
> cases...

So it will still work better than trying to do a "getsockname()" or
something. If the file descriptor really _has_ been changed, it might give
a false negative (somebody replaced it with *another* socket), but on the
other hand, that's much better than a false positive. And if somebody
replaced the socket with a real file descriptor, it will catch it..

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/