Jason Tishler writes:

>     1. If ipc-daemon is not running, then cygipc's shmget() will return
>        EACCES.
>     2. This causes PostgreSQL's InternalIpcMemoryCreate() to return
>        NULL.
>     3. This causes PostgreSQL's PGSharedMemoryCreate() to spin looking
>        for accessible shared memory which it will never find.

To me, this is a bug in PostgreSQL.  A comment in
InternalIpcMemoryCreate() says

         * Fail quietly if error indicates a collision with existing
         * segment. One would expect EEXIST, given that we said IPC_EXCL,
         * but perhaps we could get a permission violation instead?

I tend to think that the answer to that question is No.

> After reading the shmget() man page, I choose to return ENOSPC.  Is
> there a better choice?  Such as ENOMEM?

My first thought was ENOSYS (system call not implemented -- what BSD
kernels tend to return if you didn't compile them with SysV IPC support),
but that isn't a clearly superior choice either.  Fixing PostgreSQL is
probably better and quicker to yield a return.

-- 
Peter Eisentraut   [EMAIL PROTECTED]


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to