[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PIPE_BUF and read with SIZE < 0
From: |
Robert Millan |
Subject: |
PIPE_BUF and read with SIZE < 0 |
Date: |
Wed, 23 Apr 2003 22:20:58 +0200 |
User-agent: |
Mutt/1.5.4i |
hi there,
got a pair of questions:
- is the behaviour of read() undefined when the SIZE argument is a
negative value?
- on Glibc, what does read() do when SIZE is negative? it appears to me
that it's reading untill EOF, but i couldn't tell.
i ask this to clear out a bit on the PIPE_BUF porting issue. depending
on the response something like the below would or would not be ok:
#ifdef PIPE_BUF
read(fd, buf, PIPE_BUF - 1);
#else
read(fd, buf, fpathconf (fd, _PC_PIPE_BUF) - 1);
#endif
--
Robert Millan
make: *** No rule to make target `war'. Stop.
Another world is possible - Just say no to genocide
- PIPE_BUF and read with SIZE < 0,
Robert Millan <=