netdev
[Top] [All Lists]

Re: kernel bug in socketpair()

To: davem@xxxxxxxxxx, gsf@xxxxxxxxxxxxxxxx
Subject: Re: kernel bug in socketpair()
From: Glenn Fowler <gsf@xxxxxxxxxxxxxxxx>
Date: Wed, 23 Jul 2003 15:29:03 -0400 (EDT)
Cc: dgk@xxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
Organization: AT&T Labs Research
References: <200307231428.KAA15254@xxxxxxxxxxxxxxxxxxxxxxx> <20030723074615.25eea776.davem@xxxxxxxxxx> <200307231656.MAA69129@xxxxxxxxxxxxxxxxxxxxxxx> <20030723100043.18d5b025.davem@xxxxxxxxxx> <200307231724.NAA90957@xxxxxxxxxxxxxxxxxxxxxxx> <20030723103135.3eac4cd2.davem@xxxxxxxxxx> <200307231814.OAA74344@xxxxxxxxxxxxxxxxxxxxxxx> <20030723112307.5b8ae55c.davem@xxxxxxxxxx> <200307231854.OAA90112@xxxxxxxxxxxxxxxxxxxxxxx> <20030723120457.206dc02d.davem@xxxxxxxxxx> <200307231911.PAA35164@xxxxxxxxxxxxxxxxxxxxxxx> <20030723121436.10d53965.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 23 Jul 2003 12:14:36 -0700 David S. Miller wrote:
> I missed the reason why you can't use pipes and bash
> is able to, what is it?

we have some applications, ksh included, with semantics that require
stdin be read at most one line at a time; an inefficient implementation
of this does 1 byte read()s until newline is read; an efficient
implementation does a peek read (without advancing the read/seek offset),
determines how many chars to read up to and including the newline,
and then read()s that much

linux has ioctl(I_PEEK) for stream devices and recv() for sockets,
and neither of these work on pipes; if there is a linux alternative
for pipes then we'd be glad to use it

we switched from pipe() to socketpair() to take advantage of the linux
recv() peek read


<Prev in Thread] Current Thread [Next in Thread>