2002-03-04 Robert Collins <rbtcollins@hotmail.com>

* cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
        * shm.cc (shmdt): Implement.
This commit is contained in:
Robert Collins
2002-03-04 08:12:53 +00:00
parent 67be0adb71
commit 038c71f10c
4 changed files with 76 additions and 2 deletions

View File

@ -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)
{