What's a good prototype for write(2)?

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Oct 28 05:59:52 AEST 1988


In article <21763 at watmath.waterloo.edu> rbutterworth at watmath.waterloo.edu (Ray Butterworth) writes:
>How about:
>    extern ptrdiff_t write(int, const void *, size_t);
>since the last parameter has to be as big as the buffer
>(which you can take sizeof), and the return value has
>to be at least that big and also allow a negative value.

NO!  There is no guarantee that any C data object can be written
with a single call to write().  Don't go changing the interface
from what it is to what you think it should have been.  Invent a
new function instead.



More information about the Comp.std.c mailing list