Article View: news.software.nntp
Article #40542Re: Diablo debugging problems...
From: Kjetil Torgrim Homme
Date: Tue, 05 Oct 1999 00:00
Date: Tue, 05 Oct 1999 00:00
33 lines
2222 bytes
2222 bytes
[Joe Greco]
> I'm actually tempted to go look at POSIX for more info. Solaris
> man pages for write(2) suggest that write is guaranteed to write
> the bytes, assuming neither O_NONBLOCK nor O_NDELAY are set on the
> fd.
Well, the Solaris man page clearly states:
If a write() requests that more bytes be written than there
is room for-for example, if the write would exceed the pro-
cess file size limit (see getrlimit(2) and ulimit(2)), the
system file size limit, or the free space on the device-only
as many bytes as there is room for will be written. For
example, suppose there is space for 20 bytes more in a file
before reaching a limit. A write() of 512-bytes returns 20.
The next write() of a non-zero number of bytes gives a
failure return (except as noted for pipes and FIFO below).
If write() is interrupted by a signal before it writes any
data, it will return -1 with errno set to EINTR.
If write() is interrupted by a signal after it successfully
writes some data, it will return the number of bytes writ-
ten.
So it quite is pertinent to check for the return value. Receiving
SIGCHLD while writing isn't that unlikely.
Kjetil T.
Technical Details
Message-ID:
<1roged601e.fsf@haey.ifi.uio.no>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<brad-0110991517500001@brad.techos.skynet.be> <brad-0510991317560001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com>Show Full Headers
Complete Article Headers
Message-ID: <1roged601e.fsf@haey.ifi.uio.no> Subject: Re: Diablo debugging problems... Date: Tue, 05 Oct 1999 00:00:00 +0000 From: Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> References: <brad-0110991517500001@brad.techos.skynet.be> <brad-0510991317560001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 533210174 X-Complaints-To: usenet@maud.ifi.uio.no X-Trace: maud.ifi.uio.no 939154253 21672 129.240.64.139 (5 Oct 1999 20:10:53 GMT) Organization: Dept. of Informatics, University of Oslo, Norway NNTP-Posting-Date: 5 Oct 1999 20:10:53 GMT Newsgroups: news.software.nntp