diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-03-30 19:21:18 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-03-30 19:21:18 +0400 |
commit | d2714c5eda9c13f9aec9436d0f99bf263b3d4d88 (patch) | |
tree | 1b4bfaf8641b4e9194ae6dc54f2f191f9e0e81be | |
parent | 5c7b73ed978ba139423813144e4eecccf016c81a (diff) |
* sysv_shm.cc (shmget): Allow to retrieve shared memory segments
by shmid when IPC_KEY_IS_SHMID is set.
-rw-r--r-- | winsup/cygserver/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygserver/sysv_shm.cc | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index 761056afa..8af654cdc 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -1,3 +1,8 @@ +2004-03-30 Corinna Vinschen <corinna@vinschen.de> + + * sysv_shm.cc (shmget): Allow to retrieve shared memory segments + by shmid when IPC_KEY_IS_SHMID is set. + 2004-03-02 Corinna Vinschen <corinna@vinschen.de> * sysv_sem.cc (semundo_adjust): Check for process id instead of diff --git a/winsup/cygserver/sysv_shm.cc b/winsup/cygserver/sysv_shm.cc index 70ed1a3d4..7d038f0a6 100644 --- a/winsup/cygserver/sysv_shm.cc +++ b/winsup/cygserver/sysv_shm.cc @@ -808,6 +808,12 @@ shmget(struct thread *td, struct shmget_args *uap) mode = uap->shmflg & ACCESSPERMS; if (uap->key != IPC_PRIVATE) { again: +#ifdef __CYGWIN__ + if (uap->shmflg & IPC_KEY_IS_SHMID) + segnum = shm_find_segment_by_shmid ((int) uap->key) ? + IPCID_TO_IX((int) uap->key) : -1; + else +#endif segnum = shm_find_segment_by_key(uap->key); if (segnum >= 0) { error = shmget_existing(td, uap, mode, segnum); |