Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SHMCAT(1)		    General Commands Manual		     SHMCAT(1)

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

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

DESCRIPTION
       Dump shared memory segments, files, standard input and/or text to stan-
       dard  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  op-
       tion 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 ad-
       dress 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.

OPTIONS
       -h, -?, --help
	      Display usage information	and quit without dumping anything.

       -S, --stop
	      By default, if an	OPERAND	cannot be read,	shmcat tries  to  con-
	      tinue with the remaining OPERANDs. This option turns of that be-
	      havior,  so  that	 the program stops immediately after the first
	      OPERAND that cannot be read.

       -V, --version
	      Show version information and quit	without	further	action.

OPERANDS
       -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.

EXIT CODES
       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  op-
	      tion,  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.

NOTES
       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 mem-
       ory data	usually	has a binary form and thus it may  contain  non-print-
       able  characters. You also probably want	to suspend the processes writ-
       ing to the shared memory	object in order	to get a consistent dump.

AUTHOR
       Stefan Gast

SEE ALSO
       ftok(1),	ipcs(1), shmat(2), shmget(2), shm_open(3)

shmcat(1)			  August 2016			     SHMCAT(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=shmcat&sektion=1&manpath=FreeBSD+Ports+15.0>

home | help