delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/12/09:53:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 12 May 2003 09:52:22 -0400
From: Jason Tishler <jason AT tishler DOT net>
Subject: Re: cygipc (and PostgreSQL) XP problem resolved!
In-reply-to: <3EBB22F5.4000801@ece.gatech.edu>
To: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
Cc: cygwin AT cygwin DOT com
Mail-followup-to: Charles Wilson <cwilson AT ece DOT gatech DOT edu>, cygwin AT cygwin DOT com
Message-id: <20030512135222.GA1708@tishler.net>
MIME-version: 1.0
User-Agent: Mutt/1.4i
References: <20030506174725 DOT GE1652 AT tishler DOT net>
<3EB84F52 DOT 3020608 AT ece DOT gatech DOT edu> <20030507133326 DOT GA1824 AT tishler DOT net>
<3EB9A54B DOT 8060500 AT ece DOT gatech DOT edu> <20030508135217 DOT GD512 AT tishler DOT net>
<3EBB22F5 DOT 4000801 AT ece DOT gatech DOT edu>

--Boundary_(ID_to8qyg3b6SeUnS9Vca3uiQ)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

Chuck,

On Thu, May 08, 2003 at 11:39:33PM -0400, Charles Wilson wrote:
> Jason Tishler wrote:
> >On Wed, May 07, 2003 at 08:31:07PM -0400, Charles Wilson wrote:
> >>I think this needs to be a runtime function, not a compiletime
> >>macro.
> >
> >Given Igor's validation, improvements, and corrections of/to my
> >patch, do you still want a runtime function approach?  Or, is the
> >(ugly and possibly performance affecting) macro approach OK?
> 
> Nope -- I'm an idiot.

Nope -- you are *not* an idiot.  IMO, macros are ugly and can be hard to
read.  Your initial interpretation is quite understandable.

> You and Igor are correct.

See attached for take 2 -- it fixes the issues raised by Igor:

    1. handle versions with a minor number of 0 (e.g., 6.0)
    2. check for NT explicitly (i.e, high-order bit)
    3. call GetVersion() only once
    4. remove trailing backspace

Same ChangeLog as before but please add Igor's name.  In this way, he
can feel some of the pain (i.e., private email) too. :,)

Note that issue 1 is accomplished by treating 2000 and up (instead of XP
and up) the same which is fine from both empirical evidence and the
MSDN:

    The "Local", "Global" and "Session" prefixes are reserved for system
    use and should not be used as names for kernel objects. These
    keywords are case sensitive. On Windows 2000 without Terminal
    Services, these keywords are ignored. On earlier versions of the
    system, the functions for creating or opening these objects fail if
    you specify a name containing the backslash character (\).

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--Boundary_(ID_to8qyg3b6SeUnS9Vca3uiQ)
Content-type: text/plain; charset=us-ascii; NAME=cygipc-xp-2.patch
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=cygipc-xp-2.patch

Only in cygipc-1.13-2: ftok.dep
Only in cygipc-1.13-2: ftok.o
diff -rup cygipc-1.13-2.orig/include/IpcNtLit.h cygipc-1.13-2/include/IpcNtLit.h
--- cygipc-1.13-2.orig/include/IpcNtLit.h	2002-11-12 14:14:07.000000000 -0500
+++ cygipc-1.13-2/include/IpcNtLit.h	2003-05-12 08:16:14.000000000 -0400
@@ -48,24 +48,34 @@
 /************************************************************************/
 #if defined OLDCYGIPC
 # define CYGWIN_IPCNT_PKGNAME		"cygipc_"
-# define CYGWIN_IPCNT_SEMCTL		"MultiSemCtl_"
-# define CYGWIN_IPCNT_SEMSEM		"MultiSemSem_"
-# define CYGWIN_IPCNT_SEMSHM		"MultiSemShm_"
-# define CYGWIN_IPCNT_SEMMSG		"MultiSemMsg_"
+# define CYGWIN_IPCNT_SEMCTL_BASE	"MultiSemCtl_"
+# define CYGWIN_IPCNT_SEMSEM_BASE	"MultiSemSem_"
+# define CYGWIN_IPCNT_SEMSHM_BASE	"MultiSemShm_"
+# define CYGWIN_IPCNT_SEMMSG_BASE	"MultiSemMsg_"
 # define CYGWIN_IPCNT_FILESEM		"/tmp/MultiFileSem"
 # define CYGWIN_IPCNT_FILESHM		"/tmp/MultiFileShm"
 # define CYGWIN_IPCNT_FILEMSG		"/tmp/MultiFileMsg"
 #else
 # define CYGWIN_IPCNT_PKGNAME		"cygipc2_"
-# define CYGWIN_IPCNT_SEMCTL		"MultiSemCtl2_"
-# define CYGWIN_IPCNT_SEMSEM		"MultiSemSem2_"
-# define CYGWIN_IPCNT_SEMSHM		"MultiSemShm2_"
-# define CYGWIN_IPCNT_SEMMSG		"MultiSemMsg2_"
+# define CYGWIN_IPCNT_SEMCTL_BASE	"MultiSemCtl2_"
+# define CYGWIN_IPCNT_SEMSEM_BASE	"MultiSemSem2_"
+# define CYGWIN_IPCNT_SEMSHM_BASE	"MultiSemShm2_"
+# define CYGWIN_IPCNT_SEMMSG_BASE	"MultiSemMsg2_"
 # define CYGWIN_IPCNT_FILESEM		"/tmp/MultiFileSem2"
 # define CYGWIN_IPCNT_FILESHM		"/tmp/MultiFileShm2"
 # define CYGWIN_IPCNT_FILEMSG		"/tmp/MultiFileMsg2"
 #endif
 
+#define NAMESPACE_PREFIX "Global\\"
+#define FULL_NAMESPACE_PATH(name) \
+	({DWORD ver = GetVersion(); \
+	(ver < 0x80000000 && LOBYTE(LOWORD(ver)) >= 5) ? \
+	NAMESPACE_PREFIX name : name;})
+
+#define CYGWIN_IPCNT_SEMCTL	FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMCTL_BASE)
+#define CYGWIN_IPCNT_SEMSEM	FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMSEM_BASE)
+#define CYGWIN_IPCNT_SEMSHM	FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMSHM_BASE)
+#define CYGWIN_IPCNT_SEMMSG	FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMMSG_BASE)
 /************************************************************************/
 /* SEMAPHORE								*/
 /************************************************************************/


--Boundary_(ID_to8qyg3b6SeUnS9Vca3uiQ)
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--Boundary_(ID_to8qyg3b6SeUnS9Vca3uiQ)--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019