%shmctl() function

Allows the user to receive information on a shared memory segment, set the owner, group, and  permissions of a shared memory segment, or destroy a segment.

See your host OS documentation for more information on this function.