Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!nrl-cmf!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: What's a good prototype for write(2)? Message-ID: <8777@smoke.BRL.MIL> Date: 27 Oct 88 19:59:52 GMT References: <902@vsi.COM> <6794@pasteur.Berkeley.EDU> <21763@watmath.waterloo.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: comp Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <21763@watmath.waterloo.edu> rbutterworth@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.