Proposed replacement for pipe under Win32

Started by Claudio Natoliover 22 years ago2 messagespatches
Jump to latest
#1Claudio Natoli
claudio.natoli@memetrics.com

To go in src/port/ directory.

This is to allow the handles returned by pipe to be used in select() calls
(which Win32 doesn't allow with the native pipe() call), thereby obviating
the need for reworking of the select() mechanisms in pgstat.c.

Additionally, something of the sort would be required at the top of pgstat.c

#ifdef WIN32
#define pipe(a) pgpipe(a)
#define write(a,b,c) send(a,b,c,0)
#define read(a,b,c) recv(a,b,c,0)
#endif

For reference, see this thread:
http://archives.postgresql.org/pgsql-hackers/2003-12/msg00650.php

Cheers,
Claudio

--- 
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see 
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Attachments:

pipe.capplication/octet-stream; name=pipe.cDownload
#2Bruce Momjian
bruce@momjian.us
In reply to: Claudio Natoli (#1)
Re: [PATCHES] Proposed replacement for pipe under Win32

I have applied your new pipe.c file, the macros you listed (with
modification), and the configure glue to make it work.

Patch and new file attached and applied.

---------------------------------------------------------------------------

Claudio Natoli wrote:

To go in src/port/ directory.

This is to allow the handles returned by pipe to be used in select() calls
(which Win32 doesn't allow with the native pipe() call), thereby obviating
the need for reworking of the select() mechanisms in pgstat.c.

Additionally, something of the sort would be required at the top of pgstat.c

#ifdef WIN32
#define pipe(a) pgpipe(a)
#define write(a,b,c) send(a,b,c,0)
#define read(a,b,c) recv(a,b,c,0)
#endif

For reference, see this thread:
http://archives.postgresql.org/pgsql-hackers/2003-12/msg00650.php

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+25-12
/pg/port/pipe.ctext/plainDownload