msgqueue - command utility to access message queue functions.
Synopsis
Description
Options
Examples
See Also
License
Copyright
Acknowledgements
Authors
msgqueue [ -h -? -help --help --? ]
msgqueue [options...]
msgqueue is a command line utility that permits message queues to be created, removed, queried, or modified. Each queue is identified by a unique key. Messages may be written and read from these queues. An integer type associated with messages allows some control over the order in which messages are read from the queue. Queue access is restricted by a mask similar to that used in the Unix file system.
msgqueue may be obtained from:
ftp://saf.bio.caltech.edu/pub/software/linux_or_unix_tools/
Use of msgqueue is subject to the License terms.This document describes msgqueue version 1.0.0 of 18-DEC-2002.
-c,-create Create a message queue. -key KEYVAL -mask MASK are mandatory. The queue will be owned by the person who created it. -r,-remove Remove the message queue. -key KEYVAL is mandatory. -n,-info Show information about the message queue. -key KEYVAL is mandatory. -s,-send Send the input from stdin as a message to the queue. -key KEYVAL is mandatory, -lock KEYVAL and -type TYPEVAL are optional. -t,-text message Modifies -send. Sends this message instead of stdin. -g,-get Get the next message from the queue and send it to stdout. -key KEYVAL is mandatory, -lock KEYVAL and -type TYPEVAL are optional. -next Default mode of action of -get. Reads the next message without regard to -type TYPEVAL. -match Alternate mode of action of -get. Reads the next message which matches -type TYPEVAL. -except Alternate mode of action of -get. Reads the next message which does not match -type TYPEVAL. -modify Qbytes Modifies the specified queue so that it can hold Qbytes bytes of message. This mode only works for the superuser. -key KEYVAL and -mask MASKVAL are mandatory. -n,info Write information about the specified queue to stdout. -key KEYVAL is mandatory, -y,-type TYPEVAL Specifies the integer type of a message. This value is used with the -get command to control message retrieval. Defaults to 1 if not specified explicitly. -m,-mask MASKVAL Specifies the octal protection mask for the queue, analogous to the protection mask on a Unix file. For instance, 666 allows everybody read and write access to the message queue. /TD> -mm,-maxm Experimentally determines the largest message which may be written to a message queue. A mandatory -key KEYVAL must specify an existing, empty, message queue. The result is written to stdout. This value is highly platform dependent. /TD> -k[x],-key[x] KEYVAL Specifies the integer key which determines the queue to act upon. This flag is mandatory with most modes of this program. The [x] variants expect a hexadecimal value, the regular variants a decimal value. /TD> -l,-lock Modifies the behavior of -get and -send. Normally these execute without waiting for notification of completion. This allows msgqueue to be used in a polling mode. If this flag is employed the program will lock until the action completes. For instance, when reading from a queue, it will wait forever for the next message to appear. /TD> -h -help --help -? --?? Print the help message. (Default - do not print help message.) -i Emit version, copyright, license and contact information.( Default - do not emit information.)
% msgqueue -hList the the command line options.
% msgqueue -c -k 1 -m 660Create a queue to be identified with key = 1 with an access mask 660.
% ps -ef | msgqueue -k 1 -send -type 123Pipe the output of the command into a message and send it without locking to the specified queue. Note that this may fail if the output is larger than the maximum message size.
% msgqueue -k 1 -get -type 123 -match -lockRead from the message queue the next message having type 123 and write it to stdout. Wait for that next message if one is not already present.
ipcs(8),ipcrm(8) [ (1) on Solaris ], msgrcv(2), msgsnd(2), msgctl(2)
You may run this program on any platform. You may redistribute the source code of this program subject to the condition that you do not first modify it in any way. You may distribute binary versions of this program so long as they were compiled from unmodified source code. There is no charge for using this software. You may not charge others for the use of this software.
Copyright (C) 2002 David Mathog and Caltech.
none
David Mathog, Biology Division, Caltech <mathog@caltech.edu>
| msgqueue (1) | 19 Dec 2002 |