GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SHMCAT(1) FreeBSD General Commands Manual SHMCAT(1)

shmcat - dump shared memory segments, files, standard input and/or text

shmcat [ OPTION ]... [ OPERAND ]...

Dump shared memory segments, files, standard input and/or text to standard output. If no OPERAND is given, read standard input only. If more than one OPERAND is given, dump them in order. If some of the OPERANDs cannot be read, shmcat prints an error message to standard error and tries to continue with the other OPERANDs, unless the -S or --stop option is given.

Most modern systems support two APIs for shared memory:

The older one is commonly known as the System V API. It uses numeric keys and IDs as identifiers and consists of system calls like shmget(2), shmat(2) and shmdt(2).

The newer API is called the POSIX shared memory API. It uses names in string form as identifiers. It treats shared memory similar to files, which are opened with shm_open(3) and then mapped into the program address space via mmap(2). Please note that POSIX shared memory is not supported by all versions of shmcat.

If shmcat has been compiled without getopt_long(3) support, only the short, one character OPTIONs and OPERANDs can be used. Otherwise the long ones are also available. When a long OPTION or OPERAND needs an argument, the short versions do so, as well.

-h, -?, --help
Display usage information and quit without dumping anything.
-S, --stop
By default, if an OPERAND cannot be read, shmcat tries to continue with the remaining OPERANDs. This option turns of that behavior, so that the program stops immediately after the first OPERAND that cannot be read.
-V, --version
Show version information and quit without further action.

-f, --file=FILENAME
Dump the contents of the given file.
-i, --stdin
Dump standard input.
-M, --shmkey=KEY
Dump the System V shared memory segment with the given key. The key can be given as a decimal (no prefix), octal (prefix 0), or hexadecimal (prefix 0x) number. It can, for example, be obtained using the ipcs(1) or the ftok(1) tool.
-m, --shmid=ID
Dump the System V shared memory segment with the given id. The id can be given as a decimal (no prefix), octal (prefix 0), or hexadecimal (prefix 0x) number. It can, for example, be obtained using the ipcs(1) tool.
-n, --newline
Add a line feed.
-p, --posix-shm=NAME
Dump the POSIX shared memory segment with the given name (not supported in all installations).
-t, --text=TEXT
Print the given text.

0
No errors, every OPERAND requested was dumped.
1
There was an error while opening or reading at least one OPERAND. If shmcat has been invoked with the -S or --stop option, the program stopped after this error, otherwise it tried to continue with the remaining OPERANDs (if given).
2
There was a fatal error, usually this means that shmcat could not write to standard output.
10
Wrong usage of the program.

Usually, when you dump shared memory segments, you should redirect the output of shmcat to a file or a program like od(1), because shared memory data usually has a binary form and thus it may contain non-printable characters. You also probably want to suspend the processes writing to the shared memory object in order to get a consistent dump.

Stefan Gast

ftok(1), ipcs(1), shmat(2), shmget(2), shm_open(3)
August 2016 shmcat(1)

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.