xref: /freebsd/usr.bin/ipcrm/ipcrm.1 (revision 734e82fe33aa764367791a7d603b383996c6b40b)
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.Dd December 12, 2007
25.Dt IPCRM 1
26.Os
27.Sh NAME
28.Nm ipcrm
29.Nd "remove the specified message queues, semaphore sets, and shared segments"
30.Sh SYNOPSIS
31.Nm
32.Op Fl W
33.Op Fl v
34.Op Fl q Ar msqid
35.Op Fl m Ar shmid
36.Op Fl s Ar semid
37.Op Fl Q Ar msgkey
38.Op Fl M Ar shmkey
39.Op Fl S Ar semkey
40.Ar ...
41.Sh DESCRIPTION
42The
43.Nm
44utility removes the specified message queues, semaphores and shared memory
45segments.
46These System V IPC objects can be specified by their
47creation ID or any associated key.
48.Pp
49The following options are generic:
50.Bl -tag -width indent
51.It Fl v
52If specified once with -W or with -1 for an object, it will show
53all removed objects.
54If specified twice with -W or with -1 for an objects, it will show
55all removed objects and all failed removals.
56.It Fl W
57Try to wipe all specified message queues, semaphores and shared
58memory segments.
59.It Fl y
60Use the
61.Xr kvm 3
62interface instead of the
63.Xr sysctl 3
64interface to extract the required information.
65If
66.Nm
67is to operate on the running system,
68using
69.Xr kvm 3
70will require read privileges to
71.Pa /dev/kmem .
72.El
73.Pp
74The following options are used to specify which IPC objects will be removed.
75Any number and combination of these options can be used:
76.Bl -tag -width indent
77.It Fl q Ar msqid
78Remove the message queue associated with the ID
79.Ar msqid
80from the system.
81.It Fl m Ar shmid
82Mark the shared memory segment associated with ID
83.Ar shmid
84for removal.
85This marked segment will be destroyed after the last detach.
86.It Fl s Ar semid
87Remove the semaphore set associated with ID
88.Ar semid
89from the system.
90.It Fl Q Ar msgkey
91Remove the message queue associated with key
92.Ar msgkey
93from the system.
94.It Fl M Ar shmkey
95Mark the shared memory segment associated with key
96.Ar shmkey
97for removal.
98This marked segment will be destroyed after the last detach.
99.It Fl S Ar semkey
100Remove the semaphore set associated with key
101.Ar semkey
102from the system.
103.El
104.Pp
105The identifiers and keys associated with these System V IPC objects can be
106determined by using
107.Xr ipcs 1 .
108If the identifier or the key is -1, it will remove all these objects.
109.Sh SEE ALSO
110.Xr ipcs 1
111.Sh HISTORY
112The wiping of all System V IPC objects was first implemented in
113.Fx 6.4 No and 7.1.
114.Sh AUTHORS
115The original author was
116.An Adam Glass .
117The wiping of all System V IPC objects was thought up by
118.An Callum Gibson
119and extended and implemented by
120.An Edwin Groothuis .
121