Re: epoll vs stdin/stdout

H. Peter Anvin (hpa@zytor.com)
7 Jul 2003 14:20:09 -0700


Followup to: <beckj5$e2a$1@news.cistron.nl>
By author: "Miquel van Smoorenburg" <miquels@cistron.nl>
In newsgroup: linux.dev.kernel
>
> In article <20030707200315.GA10939@mail.jlokier.co.uk>,
> Jamie Lokier <jamie@shareable.org> 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.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/