Skip site navigation (1) Skip section navigation (2)

Re: EINTR error in SunOS

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EINTR error in SunOS
Date: 2005-12-31 06:28:55
Message-ID: 8764p593vc.fsf@stark.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> writes:

> On Fri, 30 Dec 2005, Tom Lane wrote:
> >
> > I've heard of this in connection with NFS ... is your DB on an NFS
> > filesystem by any chance?
> 
> I have patched IO routines in backend/storage that POSIX says EINTR is
> possible except unlink(). Though POSIX says EINTR is not possible, during
> many regressions, I found it sometimes sets this errno on NFS (I still
> don't know where is the smoking-gun):

Well there is a reason intr is not the default for NFS mounts. It's precisely
because it breaks the traditional unix filesystem interface. Syscalls that
historically are not interruptible become interruptible and not all programs
behave properly when that occurs.

In any case POSIX explicitly allows functions to return other errors aside
from those specified as long as it's for error conditions not listed.

[Chapter 2 Section 3, paragraph 6]

  Implementations may support additional errors not included in this list, may
  generate errors included in this list under circumstances other than those
  described here, or may contain extensions or limitations that prevent some
  errors from occurring. The ERRORS section on each reference page specifies
  whether an error shall be returned, or whether it may be returned.
  Implementations shall not generate a different error number from the ones
  described here for error conditions described in this volume of IEEE Std
  1003.1-2001, but may generate additional errors unless explicitly disallowed
  for a particular function


Ironically EINTR *is* singled out to be specifically forbidden to be returned
from some system calls but only those in the Threads option which are mostly
pthread* functions. unlink isn't covered by that prohibition.

-- 
greg


In response to

Responses

pgsql-hackers by date

Next:From: Martijn van OosterhoutDate: 2005-12-31 10:38:30
Subject: Re: Removing SORTFUNC_LT/REVLT
Previous:From: Greg StarkDate: 2005-12-31 05:58:19
Subject: Re: Removing SORTFUNC_LT/REVLT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group