Re: [patch] helps fe-connect.c handle -EINTR more gracefully

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: David Ford <david(at)blue-labs(dot)org>
Cc: Brent Verner <brent(at)rcfile(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Date: 2001-10-26 21:04:39
Message-ID: Pine.LNX.4.30.0110262049360.628-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Ford writes:

> Libpq doesn't deal with system calls being interrupted in the slightest.
> None of the read/write or socket calls handle any errors. Even benign
> returns i.e. EINTR are treated as fatal errors and returned. Not to
> malign, but there is no reason not to continue on and handle EINTR.

Libpq certainly does deal with system calls being interrupted: It does
not allow them to be interrupted. Take a look into the file pqsignal.c to
see why.

If your alarm timer interrupts system calls then that's because you have
installed your signal handler to allow that. In my mind, a reasonable
behaviour in that case would be to let the PQconnect or equivalent fail
and provide the errno to the application.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-10-26 21:29:09 Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Previous Message Peter Eisentraut 2001-10-26 21:03:59 Re: schema support, was Package support for Postgres