IPC on win32 - additions for 6.5.2 and current trees

Started by Horak Danielover 26 years ago1 messages
#1Horak Daniel
horak@mmp.plzen-city.cz
2 attachment(s)

Hi,

please add the file ipc.patch (patch for the cygipc library) into src/win32
directory and apply the patch for README.NT (readme.patch). I think it
should go into both the 6.5.2 and current trees.

I have no reaction from the author of the cygipc library yet, so it will be
better to include the patch into the sources of PostgreSQL

Dan

Attachments:

ipc.patchapplication/octet-stream; name=ipc.patchDownload
*** sem.c.orig	Tue Dec 01 00:16:25 1998
--- sem.c	Tue Aug 17 13:22:06 1999
***************
*** 58,63 ****
--- 58,78 ----
  static int		  GFirstSem	 = 0;		/*PCPC*/
  static int		  GFdSem	    ;		/*PCPC*/

+ static pid_t	GProcessId = 0;
+
+ static void	init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstSem = 0;
+ 		used_sems = used_semids = max_semid = 0;
+ 		sem_seq = 0;
+ 		GProcessId = pid;
+ 	}
+ }
+
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des semaphores		*/
  /************************************************************************/
***************
*** 77,82 ****
--- 92,98 ----
  {
      int LRet ;

+ 	init_globals();
      if( GFirstSem == 0 )
      {
  	if( IsGSemSemExist() )
*** shm.c.orig	Tue Dec 01 01:04:57 1998
--- shm.c	Tue Aug 17 13:22:27 1999
***************
*** 59,64 ****
--- 59,81 ----
  static int		  GFirstShm	 = 0;		/*PCPC*/
  static int		  GFdShm	    ;		/*PCPC*/

+ /*****************************************/
+ /*	Initialization of static variables   */
+ /*****************************************/
+ static pid_t GProcessId = 0;
+ static void init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstShm = 0;
+ 		shm_rss = shm_swp = max_shmid = 0;
+ 		shm_seq = 0;
+ 		GProcessId = pid;
+ 	}
+ }
+
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des shm		*/
  /************************************************************************/
***************
*** 82,87 ****
--- 99,105 ----
  {
   int LRet ;

+  init_globals();
   if( GFirstShm == 0 )
   {
    if( IsGSemShmExist() )
*** msg.c.orig	Tue Dec 01 00:16:09 1998
--- msg.c	Tue Aug 17 13:20:04 1999
***************
*** 57,62 ****
--- 57,77 ----
  static int		  GFirstMsg	 = 0;		/*PCPC*/
  static int		  GFdMsg	    ;		/*PCPC*/

+ /*****************************************/
+ /*	Initialization of static variables   */
+ /*****************************************/
+ static pid_t GProcessId = 0;
+ static void init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstMsg = 0;
+ 		msgbytes = msghdrs = msg_seq = used_queues = max_msqid = 0;
+ 		GProcessId = pid;
+ 	}
+ }
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des semaphores		*/
  /************************************************************************/
***************
*** 79,84 ****
--- 94,100 ----
  {
   int LRet ;

+  init_globals();
   if( GFirstMsg == 0 )
   {
    if( IsGSemMsgExist() )
readme.patchapplication/octet-stream; name=readme.patchDownload
--- doc/README.NT.orig	Thu Aug 26 09:23:16 1999
+++ doc/README.NT	Mon Aug 30 14:08:43 1999
@@ -21,6 +21,7 @@
 1. Download the Cygwin32 IPC Package by Ludovic LANGE 
    http://www.multione.capgemini.fr:80/tools/pack_ipc/current.tar.gz
 2. Untar the package and follow the readme instructions.
+2a. Apply the patch from src/win32/ipc.patch
 3. I tested 1.03.
 4. I used the \cygwin-b20\h-i568-cygwin32\i586-cygwin32\lib and
 \cygwin-b20\h-i568-cygwin32\i586-cygwin32\include\sys instead of the