1.\" Copyright (c) 1994 Adam Glass 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. The name of the Author may not be used to endorse or promote products 10.\" derived from this software without specific prior written permission. 11.\" 12.\" THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND 13.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15.\" ARE DISCLAIMED. IN NO EVENT SHALL Adam Glass BE LIABLE 16.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22.\" SUCH DAMAGE. 23.\" 24.\" $FreeBSD$ 25.\"" 26.Dd December 12, 2007 27.Dt IPCRM 1 28.Os 29.Sh NAME 30.Nm ipcrm 31.Nd "remove the specified message queues, semaphore sets, and shared segments" 32.Sh SYNOPSIS 33.Nm 34.Op Fl W 35.Op Fl v 36.Op Fl q Ar msqid 37.Op Fl m Ar shmid 38.Op Fl s Ar semid 39.Op Fl Q Ar msgkey 40.Op Fl M Ar shmkey 41.Op Fl S Ar semkey 42.Ar ... 43.Sh DESCRIPTION 44The 45.Nm 46utility removes the specified message queues, semaphores and shared memory 47segments. 48These System V IPC objects can be specified by their 49creation ID or any associated key. 50.Pp 51The following options are generic: 52.Bl -tag -width indent 53.It Fl v 54If specified once with -W or with -1 for an object, it will show 55all removed objects. 56If specified twice with -W or with -1 for an objects, it will show 57all removed objects and all failed removals. 58.It Fl W 59Try to wipe all specified message queues, semaphores and shared 60memory segments. 61.It Fl y 62Use the 63.Xr kvm 3 64interface instead of the 65.Xr sysctl 3 66interface to extract the required information. 67If 68.Nm 69is to operate on the running system, 70using 71.Xr kvm 3 72will require read privileges to 73.Pa /dev/kmem . 74.El 75.Pp 76The following options are used to specify which IPC objects will be removed. 77Any number and combination of these options can be used: 78.Bl -tag -width indent 79.It Fl q Ar msqid 80Remove the message queue associated with the ID 81.Ar msqid 82from the system. 83.It Fl m Ar shmid 84Mark the shared memory segment associated with ID 85.Ar shmid 86for removal. 87This marked segment will be destroyed after the last detach. 88.It Fl s Ar semid 89Remove the semaphore set associated with ID 90.Ar semid 91from the system. 92.It Fl Q Ar msgkey 93Remove the message queue associated with key 94.Ar msgkey 95from the system. 96.It Fl M Ar shmkey 97Mark the shared memory segment associated with key 98.Ar shmkey 99for removal. 100This marked segment will be destroyed after the last detach. 101.It Fl S Ar semkey 102Remove the semaphore set associated with key 103.Ar semkey 104from the system. 105.El 106.Pp 107The identifiers and keys associated with these System V IPC objects can be 108determined by using 109.Xr ipcs 1 . 110If the identifier or the key is -1, it will remove all these objects. 111.Sh SEE ALSO 112.Xr ipcs 1 113.Sh HISTORY 114The wiping of all System V IPC objects was first implemented in 115.Fx 6.4 and 7.1. 116.Sh AUTHORS 117The original author was Adam Glass. 118The wiping of all System V IPC objects was thought up by Callum 119Gibson and extended and implemented by Edwin Groothuis. 120