Re: HEADS UP: Win32/OS2/BeOS native ports

From: "Igor Kovalenko" <Igor(dot)Kovalenko(at)motorola(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Matthew Kirkwood" <matthew(at)hairy(dot)beasts(dot)org>, "mlw" <markw(at)mohawksoft(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports
Date: 2002-05-06 22:25:21
Message-ID: 0e7701c1f54c$e96cb620$22c30191@comm.mot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> "Marc G. Fournier" <scrappy(at)hub(dot)org> writes:
> > Since our default behavior (at startup) is to have TCP sockets disabled,
> > how many OSs are there that don't support UD sockets?
>
> A quick look in the sources shows that we #undef HAVE_UNIX_SOCKETS for
> QNX, BeOS, and old cygwin versions ... which are exactly the platforms
> that don't have SysV shmem support, so those are exactly the guys who
> we're trying to fix the problem for.

Next release of QNX (6.2) will add support for UDS, but they are still not
quite portable.

>
> I do like the idea of using a Unix socket this way where available,
> though. It'd let us switch over the shmem code to using IPC_PRIVATE
> shmem key, which'd simplify that code tremendously; and we could make
> some progress against the dead-PID-in-lockfile problem.
>
> Could we get away with saying that the Unix-socket-less platforms have
> weaker protection against mistakenly restarting the postmaster? We
> could have a plain-vanilla lockfile instead of a socket lockfile on
> those platforms, which would not catch the dead-postmaster-live-backends
> case, but it'd be better than nothing. And I am not convinced that the
> shmem-connection-count check should be trusted on QNX or BeOS, anyway,
> so I'm not sure that they actually have a functioning check now.

Why can't we use named pipe (aka FIFO file) instead of UDS? I think that is
more portable... The socketpair() function also tends to be more portable
than whole UDS in general... It works on QNX4 even, but not sure about BeOS.

Another thought is, why can't we use bind() to the postmaster port to detect
other postmasters? I might be missing something, so pardon by ignorance. But
should not bind() to same port fail with EADDRINUSE unless SO_REUSEADDR is
set? I don't really know if it is set in postgres or not ...

-- igor

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-05-06 22:56:27 Re: Schemas: status report, call for developers
Previous Message jack 2002-05-06 22:23:38 Re: STILL LACKING: CVS tag for release 7.2.1