Re: cvs: php4 /ext/standard file.c
| From: | Zeev Suraski | Date: | Fri, 22 Dec 2000 17:57:58 +0000 |
| Subject: | Re: cvs: php4 /ext/standard file.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-3235@lists.php.net to get a copy of this message | ||
At 19:43 22/12/2000, Sascha Schumann wrote:
Uhm, I obviously meant that if the process doesn't get terminated. Not on
all systems do you get a signal if the disk is full. On Linux as far as I
remember, write() returns an error code. Not that this has anything to do
with what I said in the first place. On systems which send you a signal
you'll also get a signal in both cases.
Andi, would you mind educating yourself before making further
comments? "On Linux as far as I remember, .." does not sound
as if you are really familiar with the semantics of write(2).
Sascha, please, lose the attitude. It's annoying to watch such conversations even as a bystander.
When someone says 'as far as I remember', he's stating out loud that he may be wrong. What you do is considerably worse - you state opinions as if they were facts.
The API you are proposing has one problem: You cannot detect
reliably why write() did not write out as many bytes as you
specified. You cannot tell reliably whether retrying is
necessary (write only returns -1 and sets errno to EINTR, if
it has not written a single byte yet), or whether it is
harmful (SIGXFSZ).
Your API has other problems, that some would consider to be worse (data being lost without any ability to know that it was lost). I'm going to commit a serious crime by saying something in which I'm not 100% sure of, again, without 'educating' myself first - and state an assumption, that it should in fact be possible to write an implementation of full_write() that will not have any drawbacks.
For some odd reason, most major packages I've seen to date use one implementation or another of full_write(). I guess they didn't bother to educate themselves either?
Zeev
--
Zeev Suraski <zeev@zend.com>
CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/