* RE: Is there an alternative download site for IPC package?
@ 2000-02-17 5:06 Horák Daniel
2000-02-17 11:50 ` Charles S. Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Horák Daniel @ 2000-02-17 5:06 UTC (permalink / raw)
To: 'Charles S. Wilson'; +Cc: cygwin
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
> I've also mirrored it at http://cygutils.netpedia.net/ . My
> version has a few extra patches added -- for instance, the
> missing ftok() was shamelessly copied from glibc-2.1.2 --
> but has had very little testing.
Can you apply also the included patch? It was developed by some PostgreSQL
hackers (details can be found in pgsql-hackers mailing list) and corrects
the behaviour of the original version (which used some variables
uninitialized, etc). And I think the version number could be taken to 1.04.
Dan
[-- Attachment #2: cypipc.patch --]
[-- Type: text/x-diff, Size: 7996 bytes --]
*** ./ipc-daemon.c.orig Tue Dec 01 00:04:24 1998
--- ./ipc-daemon.c Fri Sep 24 13:34:16 1999
***************
*** 270,285 ****
{
itoa(100*id+Index, LBuff) ;
LHandle = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, LBuff) ;
! while (LAdrSem->current_nb[id].current_nb[Index] > 0 )
! {
! WaitForSingleObject(LHandle, 0) ;
! LAdrSem->current_nb[id].current_nb[Index]-- ;
! }
! CloseHandle(LHandle) ;
}
LAdrSem->semary[id] = IPC_UNUSED ;
LAdrSem->state[id] = 0 ;
}
else
{
for (Index = 0; Index < sma->sem_nsems; Index++)
--- 270,284 ----
{
itoa(100*id+Index, LBuff) ;
LHandle = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, LBuff) ;
! while (WaitForSingleObject(LHandle, 0) == WAIT_OBJECT_0)
! ;
! LAdrSem->current_nb[id].current_nb[Index] = 0;
! CloseHandle(LHandle) ;
}
LAdrSem->semary[id] = IPC_UNUSED ;
LAdrSem->state[id] = 0 ;
}
+ /*
else
{
for (Index = 0; Index < sma->sem_nsems; Index++)
***************
*** 288,293 ****
--- 287,293 ----
LHandle = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, LBuff) ;
}
}
+ */
}
}
*** ./msg.c.orig Tue Dec 01 00:16:09 1998
--- ./msg.c Fri Sep 17 12:50:50 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() )
*** ./sem.c.orig Tue Dec 01 00:16:25 1998
--- ./sem.c Fri Sep 17 12:47:11 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() )
***************
*** 187,193 ****
{
CloseHandle ( LHandle ) ;
}
! LHandle = CreateSemaphore(NULL, 0, 0x7FFFFFFF, LBuff) ;
if( LHandle == NULL )
{
printf( "Creation de Semaphore \"Sem\" impossible\n" ) ;
--- 203,209 ----
{
CloseHandle ( LHandle ) ;
}
! LHandle = CreateSemaphore(NULL, 0, 1, LBuff) ;
if( LHandle == NULL )
{
printf( "Creation de Semaphore \"Sem\" impossible\n" ) ;
***************
*** 357,371 ****
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! ReleaseSemaphore(LHandle, sop->sem_op, &LVal) ;
! shareadrsem->current_nb[id].current_nb[sop->sem_num] +=
! sop->sem_op ;
sem_deconnect() ;
} else {
if( sop->sem_flg == IPC_NOWAIT )
{
! LRet = WaitForSingleObject(LHandle, 0) ;
! if( LRet == WAIT_TIMEOUT )
{
debug_printf("do_semop : return -EAGAIN\n");
CYGWIN32_IPCNT_RETURN (-EAGAIN) ;
--- 373,386 ----
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! shareadrsem->current_nb[id].current_nb[sop->sem_num] +=
! sop->sem_op ;
sem_deconnect() ;
+ ReleaseSemaphore(LHandle, 1 , &LVal) ;
} else {
if( sop->sem_flg == IPC_NOWAIT )
{
! if( sop->sem_op + shareadrsem->current_nb[id].current_nb[sop->sem_num] <0 )
{
debug_printf("do_semop : return -EAGAIN\n");
CYGWIN32_IPCNT_RETURN (-EAGAIN) ;
***************
*** 375,390 ****
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! shareadrsem->current_nb[id].current_nb[sop->sem_num] -= 1 ;
sem_deconnect() ;
} else {
! LRet = WaitForSingleObject(LHandle, INFINITE) ;
if (sem_connect() == 0)
{
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! shareadrsem->current_nb[id].current_nb[sop->sem_num] -= 1 ;
sem_deconnect() ;
}
}
--- 390,407 ----
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! shareadrsem->current_nb[id].current_nb[sop->sem_num] += sop->sem_op;
sem_deconnect() ;
} else {
! while(sop->sem_op + shareadrsem->current_nb[id].current_nb[sop->sem_num] <0)
! LRet = WaitForSingleObject(LHandle, INFINITE) ;
!
if (sem_connect() == 0)
{
debug_printf("do_semop : return -EACCES\n");
CYGWIN32_IPCNT_RETURN (-EACCES) ;
}
! shareadrsem->current_nb[id].current_nb[sop->sem_num] += sop->sem_op ;
sem_deconnect() ;
}
}
***************
*** 435,441 ****
char LBuff[100] ;
HANDLE LHandle ;
long LPrevious ;
- int LIndex;
debug_printf("semctl : semid=%X semnum=%X cmd=0x%02X arg=%p\n",semid,semnum,cmd,arg);
if (semid < 0 || semnum < 0 || cmd < 0)
--- 452,457 ----
***************
*** 568,589 ****
if( LHandle != NULL )
{
if( arg.val > shareadrsem->current_nb[id].current_nb[semnum] )
! {
! ReleaseSemaphore(LHandle,
! arg.val-shareadrsem->current_nb[id].current_nb[semnum],
! &LPrevious) ;
! }
! else if (arg.val <
! shareadrsem->current_nb[id].current_nb[semnum] )
! {
! for( LIndex = arg.val;
! LIndex < shareadrsem->current_nb[id].current_nb[semnum];
! LIndex++ )
! {
! WaitForSingleObject(LHandle, 0) ;
! }
! }
! shareadrsem->current_nb[id].current_nb[semnum] = arg.val ;
}
debug_printf("semctl : SETVAL : return 0\n");
CYGWIN32_IPCNT_RETURN_DECONNECT (0);
--- 584,591 ----
if( LHandle != NULL )
{
if( arg.val > shareadrsem->current_nb[id].current_nb[semnum] )
! ReleaseSemaphore(LHandle,1,&LPrevious) ;
! shareadrsem->current_nb[id].current_nb[semnum] = arg.val ;
}
debug_printf("semctl : SETVAL : return 0\n");
CYGWIN32_IPCNT_RETURN_DECONNECT (0);
*** ./shm.c.orig Fri Sep 17 12:46:24 1999
--- ./shm.c Fri Sep 17 12:47:11 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() )
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Is there an alternative download site for IPC package?
2000-02-17 5:06 Is there an alternative download site for IPC package? Horák Daniel
@ 2000-02-17 11:50 ` Charles S. Wilson
0 siblings, 0 replies; 8+ messages in thread
From: Charles S. Wilson @ 2000-02-17 11:50 UTC (permalink / raw)
To: Horák Daniel; +Cc: cygwin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]
Horák:
Sure, I'll apply this and update the packages on the website. Thanks for the
feedback
--Chuck
Horák Daniel wrote:
> > I've also mirrored it at http://cygutils.netpedia.net/ . My
> > version has a few extra patches added -- for instance, the
> > missing ftok() was shamelessly copied from glibc-2.1.2 --
> > but has had very little testing.
>
> Can you apply also the included patch? It was developed by some PostgreSQL
> hackers (details can be found in pgsql-hackers mailing list) and corrects
> the behaviour of the original version (which used some variables
> uninitialized, etc). And I think the version number could be taken to 1.04.
>
> Dan
>
> ------------------------------------------------------------
> Name: cypipc.patch
> cypipc.patch Type: application/x-unknown-content-type-patch_auto_file
> Encoding: quoted-printable
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Is there an alternative download site for IPC package?
2000-02-17 8:10 Fifer, Eric
@ 2000-02-17 11:51 ` Charles S. Wilson
0 siblings, 0 replies; 8+ messages in thread
From: Charles S. Wilson @ 2000-02-17 11:51 UTC (permalink / raw)
To: Fifer, Eric; +Cc: cygwin
Eric -
No problem. I'll update the cygipc package later today, which both
patches. Thanks for the feedback.
--Chuck
"Fifer, Eric" wrote:
> Also, please apply my included patch. It moves a private structure
> definition from
> the public include/sys/sem.h (where g++ doesn't like it) into a private
> header.
>
> Thanks.
>
> Eric Fifer
>
> ------------------------------------------------------------
> Name: cygipc.patch2
> cygipc.patch2 Type: unspecified type (application/octet-stream)
> Encoding: quoted-printable
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Is there an alternative download site for IPC package?
@ 2000-02-17 8:10 Fifer, Eric
2000-02-17 11:51 ` Charles S. Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Fifer, Eric @ 2000-02-17 8:10 UTC (permalink / raw)
To: 'Charles S. Wilson'; +Cc: cygwin
[-- Attachment #1: Type: text/plain, Size: 186 bytes --]
Also, please apply my included patch. It moves a private structure
definition from
the public include/sys/sem.h (where g++ doesn't like it) into a private
header.
Thanks.
Eric Fifer
[-- Attachment #2: cygipc.patch2 --]
[-- Type: text/x-diff, Size: 1024 bytes --]
diff -u -r cygipc-1.03.orig/include/IpcNtStr.h cygipc-1.03/include/IpcNtStr.h
--- cygipc-1.03.orig/include/IpcNtStr.h Sat Feb 05 07:42:28 2000
+++ cygipc-1.03/include/IpcNtStr.h Thu Feb 17 15:56:11 2000
@@ -68,7 +68,9 @@
struct semid_ds *semary[SEMMNI];
int state[SEMMNI] ;
- struct current_nb current_nb[SEMMNI] ;
+ struct current_nb {
+ int current_nb[SEMOPM];
+ } current_nb[SEMMNI];
int used_sems ;
int used_semids ;
diff -u -r cygipc-1.03.orig/include/sys/sem.h cygipc-1.03/include/sys/sem.h
--- cygipc-1.03.orig/include/sys/sem.h Sat Feb 05 07:42:23 2000
+++ cygipc-1.03/include/sys/sem.h Thu Feb 17 15:52:53 2000
@@ -96,12 +96,7 @@
#define SEMAEM (SEMVMX >> 1) /* adjust on exit max value */
#define SEMMAP SEMMNS /* # of entries in semaphore map */
#define SEMUSZ 20 /* sizeof struct sem_undo */
-
-struct current_nb {
-
- int current_nb[SEMOPM] ;
-} ;
-
+
/* One semaphore structure for each semaphore in the system. */
struct sem {
short semval; /* current value */
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Is there an alternative download site for IPC package?
2000-02-16 6:24 Ferenc Habony
@ 2000-02-16 10:50 ` Charles S. Wilson
0 siblings, 0 replies; 8+ messages in thread
From: Charles S. Wilson @ 2000-02-16 10:50 UTC (permalink / raw)
To: Ferenc Habony; +Cc: cygwin
I've also mirrored it at http://cygutils.netpedia.net/ . My
version has a few extra patches added -- for instance, the
missing ftok() was shamelessly copied from glibc-2.1.2 --
but has had very little testing.
--Chuck
Ferenc Habony wrote:
>
> Anyone know where to find cygwin32_ipc-1.03.tar.gz ??
> I attempt to reach it from this site
> http://www.multione.capgemeni.fr:80/tools/pack_ipc/current.tar.gz
> but it seems to bee down.
>
> I'm grateful for any help.
> /Ferenc
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Is there an alternative download site for IPC package?
@ 2000-02-16 6:34 Horák Daniel
0 siblings, 0 replies; 8+ messages in thread
From: Horák Daniel @ 2000-02-16 6:34 UTC (permalink / raw)
To: cygwin
> Anyone know where to find cygwin32_ipc-1.03.tar.gz ??
> I attempt to reach it from this site
> http://www.multione.capgemeni.fr:80/tools/pack_ipc/current.tar.gz
> but it seems to bee down.
Try http://penguin.cz/~horak/cygwin32_ipc-1.03.tar.gz
Dan
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Is there an alternative download site for IPC package?
@ 2000-02-16 6:24 Ferenc Habony
2000-02-16 10:50 ` Charles S. Wilson
0 siblings, 1 reply; 8+ messages in thread
From: Ferenc Habony @ 2000-02-16 6:24 UTC (permalink / raw)
To: cygwin
Anyone know where to find cygwin32_ipc-1.03.tar.gz ??
I attempt to reach it from this site
http://www.multione.capgemeni.fr:80/tools/pack_ipc/current.tar.gz
but it seems to bee down.
I'm grateful for any help.
/Ferenc
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Is there an alternative download site for IPC package?
@ 2000-01-26 17:24 Brian K. Smith
0 siblings, 0 replies; 8+ messages in thread
From: Brian K. Smith @ 2000-01-26 17:24 UTC (permalink / raw)
To: cygwin
I was wanting to down load the IPC source package from
http://www.multione.capgemini.fr/tools/pack_ipc/
but the server is not responding. Is there an alternative? or could
somebody email it to me?
I appreciate any help.
Brian Smith
brainkage@worldnet.att.net
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2000-02-17 11:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-17 5:06 Is there an alternative download site for IPC package? Horák Daniel
2000-02-17 11:50 ` Charles S. Wilson
-- strict thread matches above, loose matches on Subject: below --
2000-02-17 8:10 Fifer, Eric
2000-02-17 11:51 ` Charles S. Wilson
2000-02-16 6:34 Horák Daniel
2000-02-16 6:24 Ferenc Habony
2000-02-16 10:50 ` Charles S. Wilson
2000-01-26 17:24 Brian K. Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).