Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory - Mailing list pgsql-general

From Chris Jones
Subject Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Date
Msg-id 20010523114451.F437@mt.sri.com
Whole thread Raw
In response to Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory  (Chris Jones <chris@mt.sri.com>)
Responses Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@mt.sri.com -----------------------------------------------------
Chris Jones                                    SRI International, Inc.
                                                           www.sri.com

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Next
From: "Mihai Gheorghiu"
Date:
Subject: Connection from Win machine