Re: APC/socket fix (final?) - Mailing list pgsql-patches

From Tom Lane
Subject Re: APC/socket fix (final?)
Date
Msg-id 16813.1080263262@sss.pgh.pa.us
Whole thread Raw
In response to Re: APC/socket fix (final?)  (Claudio Natoli <claudio.natoli@memetrics.com>)
List pgsql-patches
Claudio Natoli <claudio.natoli@memetrics.com> writes:
>> I'm loath to invent pg_select() but it might be cleaner than this.

> We'd also need pg_recv() and pg_send(). Chances are it can happen with every
> blocking socket call :-(

Ugh.  Is there a way we can insert a wrapper layer without modifying the
call sites?  I'm thinking of some kind of macro hack, say

    #ifdef WIN32
    #define select(...)  pg_select(...)
    #endif

and then provide a port module that goes roughly like

    #undef select

    pg_select(...)
    {
        foo = select(...);
        // fix errno here;
        return foo;
    }

The fewer places that have to know about this sort of thing, the better
off we will be.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: installdir patch for win32
Next
From: Claudio Natoli
Date:
Subject: Re: APC/socket fix (final?)