Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory

From: Chris Jones <chris(at)mt(dot)sri(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Date: 2001-05-23 17:44:51
Message-ID: 20010523114451.F437@mt.sri.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 23, 2001 at 11:39:15AM -0600, Chris Jones wrote:

> No, it could be any number of other things. The first that comes to
> mind is EINTR. How about something closer to:

Hmm. Actually, write(2) shouldn't return EINTR; it should return a
short read count. But other errno values include EDQUOT and EFBIG.
So the code I suggested is not very good, either. Better to just do:

> totalwritten = 0;
> while(totalwritten < expectedbytecount) {
> lastwritten = write(...);
> if(lastwritten == -1) {
> /* errno is guaranteed to be set */
> unlink(tmp);
> elog(...);
> break;
> } else {
> /* we got a partial write count. No problem; try again. */
> totalwritten += lastwritten;
> }
> }

Chris

--
chris(at)mt(dot)sri(dot)com -----------------------------------------------------
Chris Jones SRI International, Inc.
www.sri.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-05-23 17:47:37 Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Previous Message Chris Jones 2001-05-23 17:39:15 Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory