diff options
author | Robert Collins <rbtcollins@hotmail.com> | 2002-03-04 11:12:53 +0300 |
---|---|---|
committer | Robert Collins <rbtcollins@hotmail.com> | 2002-03-04 11:12:53 +0300 |
commit | 038c71f10c12a60698a801a95321e874e30e50d4 (patch) | |
tree | cc34df2ac6fad79f87d10c7e126a2401db4c57df /winsup/cygwin/cygserver_shm.cc | |
parent | 67be0adb710ef4e53bd494ad1d19c15db6eb500d (diff) |
2002-03-04 Robert Collins <rbtcollins@hotmail.com>
* cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
* shm.cc (shmdt): Implement.
Diffstat (limited to 'winsup/cygwin/cygserver_shm.cc')
-rwxr-xr-x | winsup/cygwin/cygserver_shm.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/cygwin/cygserver_shm.cc b/winsup/cygwin/cygserver_shm.cc index de3e61e4e..50ca42e0e 100755 --- a/winsup/cygwin/cygserver_shm.cc +++ b/winsup/cygwin/cygserver_shm.cc @@ -290,6 +290,26 @@ client_request_shm::serve (transport_layer_base * conn, process_cache * cache) return; } + /* Someone detached */ + if (parameters.in.type == SHM_DETACH) + { + shmnode *tempnode = shm_head; + while (tempnode) + { + if (tempnode->shm_id == parameters.in.shm_id) + { + InterlockedDecrement (&tempnode->shmds->shm_nattch); + header.error_code = 0; + CloseHandle (token_handle); + return; + } + tempnode = tempnode->next; + } + header.error_code = EINVAL; + CloseHandle (token_handle); + return; + } + /* Someone wants the ID removed. */ if (parameters.in.type == SHM_DEL) { |