RFD: cygipc ENOSYS patch

Jason Tishler jason@tishler.net
Tue Nov 5 07:33:00 GMT 2002


On Wed, Oct 30, 2002 at 08:35:41PM +0100, Peter Eisentraut wrote:
> I'm getting tired of the "initdb hangs" class of complaints.  Why
> doesn't the relevant function fail if the ipc-daemon isn't running?
> Can anything be done in that area?

Motivated by the above, I finally looked into this long standing Cygwin
PostgreSQL problem.  Specifically, Cygwin PostgreSQL will hang and
consume all available CPU cycles if cygipc's ipc-daemon is not running
when either initdb or postmaster is started.

I'm proposing that the attached patch (against cygipc-1.11-1) be applied
to cygipc since it solves the Cygwin PostgreSQL hang problems.
Specifically, this patch changes cygipc's shmget() and semget() to
return ENOSYS instead of EACCES if ipc-daemon is not running.

However, I'm concerned that this change could adversely affect other
applications (e.g., Cygwin KDE) that rely on cygipc.  Would a such a
user be willing to try a pre-built, already patched version of cygipc?
If so, then this package can be found at:

    http://www.tishler.net/jason/software/cygipc/

Please report your findings to the Cygwin list.

If interested, see the following PostgreSQL mailing thread (which is
split over two months) for supporting information:

    http://archives.postgresql.org/pgsql-cygwin/2002-10/msg00067.php
    http://archives.postgresql.org/pgsql-cygwin/2002-11/msg00008.php

Thanks,
Jason

-- 
GPG key available on key servers or http://www.tishler.net/jason/gpg.txt
-------------- next part --------------
diff -rup cygipc-1.11-1.orig/sem.c cygipc-1.11-1p1/sem.c
--- cygipc-1.11-1.orig/sem.c	2001-11-26 18:41:32.000000000 -0500
+++ cygipc-1.11-1p1/sem.c	2002-11-05 09:25:37.000000000 -0500
@@ -326,8 +326,8 @@ debug_printf("semget : return -EINVAL\n"
 
 	if (sem_connect() == 0)
 	{
-debug_printf("semget : return -EACCES\n");
-	    CYGWIN_IPCNT_RETURN (-EACCES) ;
+debug_printf("semget : return -ENOSYS\n");
+	    CYGWIN_IPCNT_RETURN (-ENOSYS) ;
 	}
 
 	if (key == IPC_PRIVATE)
diff -rup cygipc-1.11-1.orig/shm.c cygipc-1.11-1p1/shm.c
--- cygipc-1.11-1.orig/shm.c	2001-02-10 18:50:01.000000000 -0500
+++ cygipc-1.11-1p1/shm.c	2002-11-05 09:25:37.000000000 -0500
@@ -262,8 +262,8 @@ int shmget (key_t key, int size, int shm
 debug_printf("shmget : key=%p size=%X shmflg=%X\n",key,size,shmflg);	
 	if (shm_connect() == 0)
 	{
-debug_printf("shmget : return -EACCES\n");
-	    CYGWIN_IPCNT_RETURN (-EACCES) ;
+debug_printf("shmget : return -ENOSYS\n");
+	    CYGWIN_IPCNT_RETURN (-ENOSYS) ;
 	}
 
 	if (size < 0 )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20021105/d643011b/attachment.sig>


More information about the Cygwin mailing list