Re: PROPOSAL: extend pipe() to support NULL argument.

From: Albert ARIBAUD
Date: Mon Jul 06 2009 - 02:17:57 EST


Changli Gao a Ãcrit :
On Fri, Jul 3, 2009 at 6:28 PM, Albert ARIBAUD<albert.aribaud@xxxxxxx> wrote:
Changli Gao a Ãcrit :

Yea, in many cases, max fd number must be enlarged. More fds means
more memory. Although memory is cheaper today, we have to do our best
to save money.
Sorry for interrupting, but I don't see how pipe could return a single fd,
considering there are two (partly) independent ends, each being read (resp.
written) in their own time, and an fd has only one "current read/write
position" IIUC.

If the proposal is to have two independent positions (one for reads and one
for writes) for a single fd, then I am not sure the gain in the number of
fds used is worth the loss in the increased size of the fd structure.

Am I missing something?
>
pipe doesn't support llseek.

I wasn't thinking of actively seeking a file position, but simply that reads and writes were independent (and both variable) in size, thus even without (l)seeking, each endpoint has an independent read (resp. write) position to track what's been read from (resp.written into) it at any time, and such a position is, IIUC, single for a given fd, making a fd (a struct file) insufficient for representing a pipe.

Amicalement,
--
Albert.
--
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/