Glenn Fowler wrote: > 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
Yes, sorry for the lack of clarity on my part. Being able to peek ahead when reading from a pipe would be very useful imho. All I meant is that and I was sloppy about the words used (i.e., the details of the API do not matter much). I will try to find time to mock up a pipe_peek() syscall (just as a prototype) for Linux some time this week. I would be happy if people on other platforms without support for this (and others on Linux, too) try something similar so we can compare notes and decide what to standardize on. Thanks.
