Re: [HACKERS] query log corrupted-looking entries

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "George Pavlov" <gpavlov(at)mynewplace(dot)com>, <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] query log corrupted-looking entries
Date: 2006-10-18 20:46:08
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FC72@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> > > Should work fine on Windows. fileno() is deprecated however, with
> > > the following comment:
> > > C:\Program Files\Microsoft Visual Studio
> > > 8\VC\INCLUDE\stdio.h(688) : see
> > > declaration of 'fileno'
> > > Message: 'The POSIX name for this item is deprecated.
> > > Instead, use the ISO C++ conformant name: _fileno. See
> online help for details.'
> >
> > Only Microsoft would think that they get to unilaterally
> deprecate a
> > POSIX standard API :-(

Well.
a) It's not a POSIX platform.
b) There is a #define you can set to disable the deprecation, from what
I can tell.

> Yeah, these are the same guys who chose to implement select()
> to only work on sockets and not on plain file descriptors
> (for example you can't make it work on a pipe). This must be
> the single most far-reaching change they did to POSIX
> compatibility. It's incredibly idiotic and problematic. And
> note that it's not that it's deprecated -- it just doesn't
> work at all :-(

You will notice that in the win32 API there is no such thing as a "plain
file descriptor". The Windows API has you using HANDLEs for both sockets
and files, and as long as you use the Windows API, you can pass them
both to the same function (just use waitformultipleobjects instead of
select).
select() is only in the winsock library, which is there only for
compatibility with Berkeley Sockets. And it works with sockets created
that way...

That said, it can certainly be irritating :-) Oh, and if you want it for
pipes, look at some of the port code for win32 - claudio did a pipe()
implementation that works fine with select().

//Magnus

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-10-18 20:55:38 Re: Stats Collector Won't Start
Previous Message Ron Peterson 2006-10-18 20:43:40 Re: uuid c function contrib

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2006-10-18 20:56:00 Contrib Makefiles
Previous Message Weslee Bilodeau 2006-10-18 20:46:04 Performance/Security question on caching function OIDs for a connection