we need a standard way to peek read data on a pipe without blocking or 
consuming the data

we use ioctl(I_PEEK) on pipe() on systems that feature test ok for that
and if not then recv(MSG_PEEK) on socketpair()
otherwise the much slower "cant't peek pipe data" code kicks in

rather than getting stuck on using a socket api for pipes
can we first determine that peeking pipe read data is useful
and then determine an api

On Fri, 15 Jul 2011 14:47:19 -0400 Garrett Wollman wrote:
> <<On Fri, 15 Jul 2011 13:38:44 -0500, Jonathan Nieder <jrnie...@gmail.com> 
> said:

> > Does any Unix-like platform aside from Linux lack that feature?  Is
> > there any architectural consideration that would make MSG_PEEK
> > difficult to implement for Linux's pipes?  (For the former, I have no
> > clue, while for the latter, I suspect not.)

> On FreeBSD it will error out with [ENOTSOCK].

> I would in general caution against going down this particular
> direction.  Some systems implemented pipes on top of sockets, but this
> is an implementation detail and applications which rely on that
> behavior are in error.

> -GAWollman




Reply via email to