🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5399

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

#5399
From: Doug Gwyn
Date: Thu, 27 Oct 1988 19:59
11 lines
1078 bytes
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.
Technical Details
Message-ID: <8777@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!nrl-cmf!cmcl2!adm!smoke!gwyn
References: <902@vsi.COM> <6794@pasteur.Berkeley.EDU> <21763@watmath.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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) <gwyn>)
Distribution: comp
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 11