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

Re: Re: [HACKERS] Re: WIN32 errno patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mikhail Terekhov <terekhov(at)emc(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Re: [HACKERS] Re: WIN32 errno patch
Date: 2001-08-17 15:38:58
Message-ID: 200108171538.f7HFcwQ25962@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackerspgsql-patches
OK.  Patch removed.

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I will try to apply it within the next 48 hours.
> 
> This isn't the right patch to apply, since Mikhail didn't fix the
> strerror problem.  I have some code from Magnus Naeslund that purports
> to handle the strerror issue, and will work it up into a patch real soon
> now.
> 
> >> I've implemented the SOCK_ERRNO macro only because
> >> both strerror and FormatMessage functions know nothing
> >> about sockets errors.
> 
> FWIW, Magnus says this works:
> 
> #define SOCK_STRERROR my_sock_strerror
> 
> const char* my_sock_strerror(unsigned long eno){
>     static char buf[512]; // i know, not threadsafe
>     if (!FormatMessage( 
>             FORMAT_MESSAGE_FROM_SYSTEM | 
>             FORMAT_MESSAGE_IGNORE_INSERTS,
>             0,eno,
>             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
>             buf,sizeof(buf)-1,
>             0
>            )){
>       sprintf(buf,"Unknown socket error(%u)",eno);
>     }
>     buf[sizeof(buf)-1]='\0';
>     return buf;
> }
> 
> 
> Anyone have any objections to it?
> 
> 			regards, tom lane
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-08-17 15:49:18
Subject: Re: Dollar in identifiers
Previous:From: Tom LaneDate: 2001-08-17 15:38:09
Subject: Re: Re: [HACKERS] Re: WIN32 errno patch

pgsql-committers by date

Next:From: Bruce Momjian - CVSDate: 2001-08-17 15:40:07
Subject: pgsql/src backend/libpq/auth.c backend/libpq/c ...
Previous:From: Tom LaneDate: 2001-08-17 15:38:09
Subject: Re: Re: [HACKERS] Re: WIN32 errno patch

pgsql-patches by date

Next:From: Peter EisentrautDate: 2001-08-17 16:11:00
Subject: Re: encoding names
Previous:From: Tom LaneDate: 2001-08-17 15:38:09
Subject: Re: Re: [HACKERS] Re: WIN32 errno patch

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