summaryrefslogtreecommitdiff
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2006-12-07 00:25:58 +0100
committerKarel Zak <kzak@redhat.com>2006-12-07 00:25:58 +0100
commit63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (patch)
tree433db3f0b44e0f46e4130141f4a59db9c3564557 /sys-utils
parenta2c5f3cadcfd2ceab9d37fc847fa0d800a95633a (diff)
downloadutil-linux-old-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.gz
Imported from util-linux-2.11t tarball.
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/ipcrm.8109
-rw-r--r--sys-utils/ipcs.c8
2 files changed, 75 insertions, 42 deletions
diff --git a/sys-utils/ipcrm.8 b/sys-utils/ipcrm.8
index f8281d37..6e3b97d1 100644
--- a/sys-utils/ipcrm.8
+++ b/sys-utils/ipcrm.8
@@ -6,58 +6,91 @@ ipcrm \- remove a message queue, semaphore set or shared memory id
.SH SYNOPSIS
.B ipcrm
[
-.I options
-]
+.B \-M
+.I key
+|
+.B \-m
+.I id
+|
+.B \-Q
+.I key
+|
+.B \-q
+.I id
+|
+.B \-S
+.I key
+|
+.B \-s
+.I id
+] ...
deprecated usage
.BI ipcrm
[
-.I shm
+.B shm
|
-.I msg
+.B msg
|
-.I sem
+.B sem
]
-.IR id ...
+.IR id " ..."
.SH DESCRIPTION
.I ipcrm
-will remove messages, semphores or shared memory segments specified by
-.IR key " or" " id" .
+removes System V interprocess communication (IPC) objects
+and associated data structures from the system.
+In order to delete such objects, you must be superuser, or
+the creator or owner of the object.
+
+System V IPC objects are of three types: shared memory,
+message queues, and semaphores.
+Deletion of a message queue or semaphore object is immediate
+(regardless of whether any process still holds an IPC
+identifier for the object).
+A shared memory object is only removed
+after all currently attached processes have detached
+.RB ( shmdt (2))
+the object from their virtual address space.
+
+Two syntax styles are supported. The old Linux historical syntax specifies
+a three letter keyword indicating which class of object is to be deleted,
+followed by one or more IPC identifiers for objects of this type.
+
+The SUS-compliant syntax allows the specification of
+zero or more objects of all three types in a single command line,
+with objects specified either by key or by identifier. (See below.)
+Both keys and identifiers may be specified in decimal, hexadecimal
+(specified with an initial '0x' or '0X'), or octal (specified with
+an initial '0').
+
.SH OPTIONS
-The identifiers are specified thus:
.TP
-.BI \-q " msgid"
-removes the message queue identified by
-.I msgid
-from the system along with its associated data structures.
+.BI \-M " shmkey"
+removes the shared memory segment created with
+.I shmkey
+after the last detach is performed.
.TP
.BI \-m " shmid"
removes the shared memory segment identified by
.I shmid
-from the system along with its associated data structures after the last
-detach is performed.
-.TP
-.BI \-s " semid"
-removes the semaphore identified by
-.IR semid
-from the system along with its associated data structures.
+after the last detach is performed.
.TP
.BI \-Q " msgkey"
removes the message queue created with
-.I msgkey
-from the system along with its associated data structures.
+.IR msgkey .
.TP
-.BI \-M " shmkey"
-removes the shared memory segment created with
-.I shmkey
-from the system along with its associated data structures after the last
-detach is performed.
+.BI \-q " msgid"
+removes the message queue identified by
+.IR msgid .
.TP
.BI \-S " semkey"
removes the semaphore created with
-.IR semkey
-from the system along with its associated data structures.
+.IR semkey .
+.TP
+.BI \-s " semid"
+removes the semaphore identified by
+.IR semid .
.LP
The details of the removes are described in
.IR msgctl (2),
@@ -67,23 +100,25 @@ and
The identifiers and keys may be found by using
.IR ipcs (8).
.SH NOTES
-In its first implementation, ipcrm used the deprecated syntax shown in the
+In its first Linux implementation, ipcrm used the deprecated syntax
+shown in the
.BR SYNOPSIS .
Functionality present in other *nix implementations of ipcrm has since
been added, namely the ability to delete resources by key (not just
identifier), and to respect the same command-line syntax. For backward
compatibility the previous syntax is still supported.
-.SH AUTHORS
-Andre C. Mazzone (linuxdev@karagee.com)
-.br
-Krishna Balasubramanian (balasub@cis.ohio-state.edu)
-.nh
+.\" .SH AUTHORS
+.\" Andre C. Mazzone (linuxdev@karagee.com)
+.\" .br
+.\" Krishna Balasubramanian (balasub@cis.ohio-state.edu)
.SH SEE ALSO
+.nh
.BR ipcs (8),
.BR msgctl (2),
.BR msgget (2),
.BR semctl (2),
.BR semget (2),
.BR shmctl (2),
-.BR shmget (2)
-
+.BR shmdt (2),
+.BR shmget (2),
+.BR ftok (3)
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 01cc4948..d93d4083 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -16,7 +16,6 @@
1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
- added Native Language Support
-
*/
#include <stdio.h>
@@ -430,9 +429,9 @@ void do_sem (char format)
default:
printf (_("------ Semaphore Arrays --------\n"));
- printf (_("%-10s %-10s %-10s %-10s %-10s %-12s\n"),
+ printf (_("%-10s %-10s %-10s %-10s %-10s\n"),
_("key"),_("semid"),_("owner"),_("perms"),
- _("nsems"),_("status"));
+ _("nsems"));
break;
}
@@ -461,7 +460,7 @@ void do_sem (char format)
break;
default:
- printf( "0x%08x ",ipcp->KEY );
+ printf("0x%08x ", ipcp->KEY);
if (pw)
printf ("%-10d %-10.9s", semid, pw->pw_name);
else
@@ -478,7 +477,6 @@ void do_sem (char format)
break;
}
}
- return;
}