Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jun 1996 21:42:14 GMT
From:      "Franz Hollerer"<eeg@telecom.at>
To:        FreeBSD-questions@FreeBSD.ORG
Message-ID:  <199606122142.VAA02488@fh>

next in thread | raw e-mail | index | archive | help
Hi,

I use semaphore to control read and write access to a
shared memory.
For the different semop() I set the SEM_UNDO flag.
So the kernel should undo the semaphore operations if the
process exits or is killed.
With Linux and SCO this works. But under FreeBSD 2.1
all other processes (which wait for the semaphore) hang.

*) Please, can someone tell me, if this is a bug in
   my program or a bug in the FreeBSD kernel?


/* ============================================================ */
/*    code fragment for locking share memory with a semaphore   */ 
/* ============================================================ */

extern gshm_t *shm;

#define SHM_UNLOCKED 0
#define SHM_RDLOCKED 1
#define SHM_WRLOCKED 2

static int shm_id, sem_id;
static int lock=SHM_UNLOCKED;

/* ============================================================ */




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606122142.VAA02488>