Re: epoll vs stdin/stdout

From: H. Peter Anvin (
Date: Mon Jul 07 2003 - 16:20:09 EST

Followup to: <beckj5$e2a$>
By author: "Miquel van Smoorenburg" <>
In newsgroup:
> In article <>,
> Jamie Lokier <> wrote:
> >Unfortunately I cannot think of a way for a process to know, in
> >general, whether two fds that it is passed correspond to the same file
> >*. Well, apart from trying epoll on it and seeing what happens :/
> fstat() and compare st_dev and st_ino

That doesn't show if they share the same file *. Two fd's can be open
to the same file or other object without sharing the same file *.

Seriously, this is not something userspace should have to worry
about. The interface should handle it, otherwise it's broken.


<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:30 EST