AFAIK, the limit is PIPE_BUF (in limits.h or sys/param.h), i.e. 5120, and it
is not adjustable (unlike some other OSs), which is why ulimit -p is read-only 
on Solaris.

The comment at
http://src.opensolaris.org/source/xref/onnv/onnvgate/usr/src/uts/common/fs/fifofs/fifovnops.c#957

leads me to wonder if that limit isn't tied to the implementation of pipes as
STREAMS on Solaris.  Contrast that with some BSD systems where pipes are
sockets, little different than socketpair() provides, or older flavors of Unix, 
where
pipes were neither of those, nor bi-directional as they would tend to be with 
either
of those.  SUSv3 says
> It is unspecified whether fildes[0] is also open for writing and whether 
> fildes[1] is
> also open for reading.
which I take to mean that it's non-portable to depend on pipes being 
bidirectional.

I don't know whether e.g. SVID requires that implementation, but it could
have compatibility issues to change it, given that one can push STREAMS modules
onto a pipe...not that I have a list of apps that actually do that or anything.

I also don't know whether bufmod(7m) is of any use on a STREAMS pipe, let alone
whether it affects the limit of atomic writes (but I suspect it probably doesn't
do the latter, at the very least).

Are you sure you need anything more?  I really don't think _portable_
programs are supposed to expect atomic writes on a pipe larger than
pathconf(path,_PC_PIPE_BUF), which is the same as PIPE_BUF, but determined at
runtime rather than a hardcoded constant, in case it changes in the future.
See http://www.opengroup.org/onlinepubs/009695399/functions/write.html

Even if all writes were <= PIPE_BUF, the reader might not be able to sort
out where the boundaries were, unless they were all fixed size.

One could try mapping all calls to pipe(fds) into 
socketpair(AF_UNIX,SOCK_STREAM,0, fds)
(which aside from st_mode should be mostly* transparent if done with an 
LD_PRELOADable
shared object, for example).  But I have yet to find a man page that tells me 
whether the
resulting behavior would be any sort of an improvement.

*the technique somewhat differs for passing fds across a STREAMS pipe and 
across an AF_UNIX
socketpair()
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to