From: David Korn <dgk@research.att.com>
To: davem@redhat.com, dgk@research.att.com, gsf@research.att.com,
linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: Re: kernel bug in socketpair()
Date: Wed, 23 Jul 2003 15:28:52 -0400 (EDT) [thread overview]
Message-ID: <200307231928.PAA75996@raptor.research.att.com> (raw)
cc: gsf@research.att.com dgk@research.att.com linux-kernel@vger.kernel.org netdev@oss.sgi.com
Subject: Re: Re: kernel bug in socketpair()
--------
> I missed the reason why you can't use pipes and bash
> is able to, what is it?
>
> If it's the fchown() thing, why doesn't bash have this issue?
>
>
The reason is that we want to be able to peek ahead at data in
the pipe before advancing. You can do this with recv() but
this doesn't work wtih pipes. On some systems you can use
an ioctl() for this with pipes by Linux doesn't support this
so ksh configures to use socketpair() instead of pipe()
on Linux. Without the ability to peek ahead on pipes, a command
like
cat file | { head -6 > /dev/null; cat ;}
to remove the first 6 lines of a file would be hard to implement
unless head reads one byte at a time from the pipe.
(OK, you could read 6 bytes at first if you want to optimize head.)
David Korn
dgk@research.att.com
next reply other threads:[~2003-07-23 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-23 19:28 David Korn [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-07-23 14:28 Re: kernel bug in socketpair() David Korn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200307231928.PAA75996@raptor.research.att.com \
--to=dgk@research.att.com \
--cc=davem@redhat.com \
--cc=gsf@research.att.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.