Re: Unique /proc/<pid>/fd/ inode numbers?

From: Ram Gupta
Date: Mon Jan 30 2006 - 15:30:52 EST


On 1/30/06, Bernard Blackham <bernard@xxxxxxxxxxxxxxx> wrote:
> A useful thing to be able to determine when checkpointing a process
> from userspace is whether two file descriptors that point to the
> same file are
> (a) two independently open()'d instances of the file; or
> (b) one open() and one dup().
> (the latter case meaning the FDs share locks & seek offsets).
>

I dont see a way which differentiates between open fd & dup fd. The
only difference between them is that when doing open it allocates a
new file structure & initializes it while in case of dup the same file
pointer. That's how you share the locks & seek offsets. But I dont see
any kernel code which makes this difference currently. Implementing
this should not be that hard any way

regards
Ram Gupta
-
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/