summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcs.c
Commit message (Collapse)AuthorAgeFilesLines
* textual: spell and encode the name of Arkadiusz Miśkiewicz correctlyBenno Schulenberg2013-02-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* ipcs: report an error when -i is used with multiple resourcesBenno Schulenberg2013-02-061-19/+19
| | | | | | Also put everything in POSIX order: queues, memory, sempahores. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* ipcs: fix spacing in summary outputSami Kerola2013-01-091-1/+1
| | | | | | Change 56692a6 introduced spacing error to --summary printing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: fix compiler warnings, use 64bit timeKarel Zak2012-12-201-20/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: make --human really sexyKarel Zak2012-12-191-2/+12
| | | | | | Align the "size" columns to the right. Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: add --bytes size output optionSami Kerola2012-12-191-1/+6
| | | | | | | | This makes the command being a little closer standard compliant. See IEEE Std 1003.1 referral link below for more information. References: http://pubs.opengroup.org/onlinepubs/009696799/utilities/ipcs.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: add --human readable size conversion optionSami Kerola2012-12-191-34/+54
| | | | | | | | | Introduces new function ipc_print_size() which will call size_to_human_string(), and handles the occasional '([k]bytes)' printing if default size format is requested. Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: assist debuggingSami Kerola2012-12-191-6/+9
| | | | | | | One will be able to see enum symbols when debugging, which is not the case when values are specified as define list. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: remove print_perms()Sami Kerola2012-11-231-26/+0Star
| | | | | | The function is no longer in use. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: make individual message queue id printing to use /procSami Kerola2012-11-231-24/+23Star
| | | | | | | | [kzak@redhat.com: - fix msgctl() call, move q_qbytes to ipc_msg_get_info] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: clean up do_msg(), and add ipc_msg_get_info()Sami Kerola2012-11-231-45/+44Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: make individual semaphore id printing to use /procSami Kerola2012-11-231-35/+28Star
| | | | | | | | | And reindent the print_shm() function. [kzak@redhat.com: move semctl(GET*...) calls to ipcutils.c] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: clean up do_sem(), and add ipc_sem_get_info()Sami Kerola2012-11-231-40/+40
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: make individual shared memory id printing to use /procSami Kerola2012-11-231-21/+24
| | | | | | | And reindent the print_shm() function. Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: clean up do_shm()Karel Zak2012-11-231-11/+22
| | | | | | | | - don't expect maxid as argument in ipc_shm_get_info() - if there is @id argument then use it everywhere in ipc_shm_get_info() - don't call shmctl() if not necessary in do_shm() Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: read shared memory values from /procSami Kerola2012-11-231-39/+34Star
| | | | | | | | [kzak@redhat.com: - move to ipcutils.{c,h}, - fix datatypes to be arch independent] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: determine ipc limits from /procSami Kerola2012-11-231-100/+20Star
| | | | | | | | | | | | Some of the limit values are not dynamic. Like in kernel these values are #defined. [kzak@redhat.com: - use better names for functions, - add ipcutils.{c,h} - read also shmmax from /proc] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix typos found by misspellingsBernhard Voelker2012-04-231-1/+1
| | | | | | | | | | | | | | | The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * isosize: Fix typo in usage string. * configure.ac: Fix typo in help string of --enable-most-builds option. * fdisk: Fix typo in man page. * libblkid, blkid, mount: Likewise. * Fix various typos in docs and in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: minor changes to usage()Karel Zak2011-09-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fixes to USAGE_* macrosSami Kerola2011-09-171-2/+1Star
| | | | | | | | | | | The USAGE_BEGIN_TAIL is removed as unnecessary. In between command specific options and --help & --version USAGE_SEPARATOR is inserted. For now the separator is empty line. The USAGE_MAN_TAIL is changed to take an argument. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: comment & white space clean upSami Kerola2011-09-171-86/+83Star
| | | | | | | Add to multiline comments to have left side stars, convert spaces to tabs and indent preprocessor directives Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: include-what-you-use header checkSami Kerola2011-09-171-9/+11
| | | | | | | | | | Two includes added & a sort to alphabetical order. ipcs.c should add these lines: #include <features.h> // for __GLIBC__ #include <stddef.h> // for size_t Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: add long optionsSami Kerola2011-09-171-41/+49
| | | | | | Includes necessary usage() changes. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ipcs: use unsigned type for uid/gidKarel Zak2011-08-091-17/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: fix compiler warnings [-Wsign-compare]Karel Zak2011-08-011-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: fix typoKarel Zak2011-02-211-1/+1
| | | | | Reported-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: really show all resources when -a and -i are combinedJens Kristian Søgaard2011-02-211-4/+5
| | | | | | | | When you have more than one resource with the same id (but differing types) combining -a and -i does not show all resources. This patch corrects that. Signed-off-by: Jens Kristian Søgaard <jens@mermaidconsulting.dk>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+1
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* ipcs: advise translators a different output formatFrancesco Cosoleto2010-06-301-5/+19
| | | | | | | | | Shared memory status output format need changes but there are backward compatibility problems. This is a invite to apply in translations the same style used for the rest of the summaries as well as for the limits reported by -l option. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* ipcs: reorganize help and usage textsFrancesco Cosoleto2010-06-011-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Help text old version: ipcs provides information on ipc facilities for which you have read access. Resource Specification: -m : shared_mem -q : messages -s : semaphores -a : all (default) Output Format: -t : time -p : pid -c : creator -l : limits -u : summary -i id [-s -q -m] : details on resource identified by id usage : ipcs -asmq -tclup ipcs [-s -m -q] -i id ipcs -h for help. New version: Usage: ipcs [resource]... [output-format] ipcs [resource] -i id Provide information on IPC facilities for which you have read access. -h display this help -i id print details on resource identified by id Resource options: -m shared memory segments -q message queues -s semaphores -a all (default) Output format: -t time -p pid -c creator -l limits -u summary Usage text old version: usage : ipcs -asmq -tclup ipcs [-s -m -q] -i id ipcs -h for help. New version: Usage: ipcs [-asmq] [-t|-c|-l|-u|-p] ipcs [-s|-m|-q] -i id ipcs -h for help [kzak@redhat.com: - use program_invocation_short_name - minor cleanups] Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: add missing "PIDs" to related shared memory header textFrancesco Cosoleto2010-06-011-1/+1
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* ipcs: get rid of colons from header strings for consistencyFrancesco Cosoleto2010-06-011-3/+3
| | | | | | | | | | | | This changes output of -u, -l, and -c. Example of non consistent output: $ ipcs -u | grep ^--- ------ Shared Memory Status -------- ------ Semaphore Status -------- ------ Messages: Status -------- Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* ipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__Guillem Jover2009-10-091-3/+1Star
| | | | | | | | The latter is obsolete and it's currently defined to 6 for historical reasons (as per comment in <features.h>) instead of 2 as what would be expected. Signed-off-by: Guillem Jover <guillem@hadrons.org>
* build-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINEDGuillem Jover2009-10-091-3/+1Star
| | | | | | | | | | | | | | Older versions of glibc used to declare ‘union semun’ in <sys/sem.h>, but POSIX.1-2001 requires the caller to declare it instead. Later versions of glibc started defining _SEM_SEMUN_UNDEFINED to note that the union was not being declared, but conforming systems are not required to define that macro (e.g. FreeBSD). As a side effect we get rid of some obsolete __GNU_LIBRARY__ macro usage. [kzak@redhat.com: - use #ifndef] Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: fix exit codes, remove tailing white-spacesKarel Zak2008-10-071-76/+61Star
| | | | | Addresses-Red-Hat-Bugzilla: #465911 Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: adjust some field positions and widths for correct alignmentBenno Schulenberg2008-08-201-5/+5
| | | | | | | | | | [kzak@redhat.com: - note that "ipcs -m -t" did not work correctly on terminal with 80 columns - the change of output alignment should be mentioned in the Release Notes] Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* ipcs: ungettextize the spacing of the table headersBenno Schulenberg2008-08-201-15/+15
| | | | | | | | It makes no sense to allow translators to adjust the spacing when they cannot adjust the spacing of the actual data too. Adjusting such spacing is not really a translator's task. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* use getpagesize()maximilian attems2008-07-301-1/+1
| | | | | | | | | | | | getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE) to anything Linux. this patch helps klibc porting effort as the sysconf multiplex API is not supported there. also remove comment of the switch to sysconf in mkswap.c. Signed-off-by: maximilian attems <max@stro.at>
* docs: tweak a few messages for clarityBenno Schulenberg2007-10-261-3/+2Star
| | | | | | | | Add a missing period, a missing space, a comma and a word for clarity, plus a period and an uppercase letter to match surrounding messages. Further add a missing call to gettext, and undo an unneeded linewrap. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* Clean up pagesize/PAGE_SIZE usage.Karel Zak2007-02-061-1/+2
| | | | | | | | | Now all code in util-linux uses sysconf(_SC_PAGESIZE) that is standardized and preferred way of querying page size. The asm/page.h file is not included to the code anymore. (This patch doesn't change mount's FS detection code which will be removed later). Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: max total shared memory in kbytes instead pagesKarel Zak2007-01-041-2/+2
| | | | | | | | | | | The ipcs command has reported "max total shared memory" as a number of pages. The others IPC limits are reported in (k)bytes, so it doesn't make sense mix pages and bytes in the same output. Now "max total shared memory" is reported in kbytes. [Migration note: type="API change", severity="low"] Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: fix typo in Semaphore headersKarel Zak2007-01-041-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.12a tarball.Karel Zak2006-12-071-16/+16
|
* Imported from util-linux-2.11y tarball.Karel Zak2006-12-071-4/+7
|
* Imported from util-linux-2.11t tarball.Karel Zak2006-12-071-5/+3Star
|
* Imported from util-linux-2.11o tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.11m tarball.Karel Zak2006-12-071-2/+2
|
* Imported from util-linux-2.11f tarball.Karel Zak2006-12-071-84/+89
|
* Imported from util-linux-2.11b tarball.Karel Zak2006-12-071-19/+27
|