summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* rtcwake: do not duplicate argument stringsDavidlohr Bueso2011-03-081-2/+2
| | | | | | | This is not necessary and prevents memory leaks. Reported-by: Marek Otahal <markotahal@gmail.com> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* move struct option to .rodataKarel Zak2011-03-036-6/+6
| | | | | | | It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: test for available suspend modesLawrence Rust2011-02-281-0/+23
| | | | Signed-off-by: Lawrence Rust <lawrence@softsystem.co.uk>
* dmesg.c: cleanups -- use err(), xalloc()Marek Polacek2011-02-281-27/+25Star
| | | | | Signed-off-by: Marek Polacek <mpolacek@redhat.com> 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>
* lscpu: use xstrdup from xalloc.hPetr Uzel2011-02-211-9/+1Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* 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>
* textual: improve the wording of some error and usage messagesBenno Schulenberg2011-02-161-8/+9
| | | | | | | | | [kzak@redhat.com: - cleanup lscpu(1) usage text - use <disk> rather than <device> in partx(8) usage text] Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix three typos in message strings and improve consistencyBenno Schulenberg2011-02-162-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-1412-12/+10Star
| | | | | | | | 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>
* lscpu: add description of --sysroot option to man page, plus grammar touchesBenno Schulenberg2011-02-081-9/+16
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* dmesg: use strtol_or_err instead of atoiDavidlohr Bueso2011-02-082-8/+10
| | | | | | | We shouldn't be accepting things like 'dmesg -n 2crapinput' This patch also changes the exit's value to use EXIT_* constants. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* lscpu: cleanup usage()Karel Zak2011-02-081-6/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* remaining util-linux-ng to util-linuxSami Kerola2011-01-231-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lscpu: fix 64bit CPU detectionKarel Zak2011-01-191-20/+33
| | | | | | | Note that the code is still not able to detect 64bit on sparcs and ppc. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use WORDS_BIGENDIAN to determine platform byte-orderFabian Groffen2011-01-171-3/+1Star
| | | | | | | | | | | | Autoconf contains the right magic to determine the endianness on many platforms next to Linux. This reverses previous commits to move away from WORDS_BIGENDIAN: "use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN" This is necessary to compile on non Linux platforms like Darwin and Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* sys-utils: fix manpage typosDavidlohr Bueso2011-01-173-3/+3
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* unshare: fix SIGSEGV on invalid command line optionAlexey Gladkov2011-01-051-0/+1
| | | | | | | | | $ unshare --hel Segmentation fault The last element of longopts has to be filled with zeros. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* lscpu: avoid len = 0 as a consequence of maxcpus = 0Gerrit Renker2010-12-311-1/+2
| | | | | | | | | | | | | | | | | | | This problem was observed on an x86_64 Mobile AMD Sempron 3700+ where kernel_max returned "0" as the index of the highest CPU. As a consequence, several variables in lscpu, which relied on maxcpus >= 1 (in particular the 'len' value) were set to 0, resulting in the following errors: host>./lscpu lscpu: failed to read: /sys/devices/system/cpu/online: No such file or directory host> cat /sys/devices/system/cpu/kernel_max 0 The fix used by this patch is to interpret kernel_max as an index and maxcpus as a count >= 1, tested to work. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
* fix __noreturn__ usageKarel Zak2010-12-101-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* renice: improve messages specifying what ID is referring toFrancesco Cosoleto2010-12-091-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello, On 30/11/2010 13:01, Karel Zak wrote: > Unfortunately, translators don't like this kind of strings where any > translatable substring is inserted to the normal sentence. It would be > better to use something like: > > "%d (%s): failed to set priority", who, idtype > > "%s: %d: failed to set priority", idtype, who > > or so... or "failed to set priority for %d (%s)"? From 536eb11f873f2c887e075a37ffb3c971cac258d5 Mon Sep 17 00:00:00 2001 From: Francesco Cosoleto <cosoleto@gmail.com> Date: Mon, 6 Dec 2010 01:23:10 +0100 Subject: [PATCH] renice: improve messages specifying what ID is referring to This version makes more clear the printed message specially when the --user option is used. Old version: $ renice 19 10 -u fra -g 1 renice: 10: setpriority: Operation not permitted renice: 1000: setpriority: Operation not permitted renice: 1: setpriority: Operation not permitted $ renice 19 -u fra 1000: old priority 0, new priority 19 New version: $ renice 19 10 -u fra -g 1 renice: failed to set priority for 10 (process ID): Operation not permitted renice: failed to set priority for 1000 (user ID): Operation not permitted renice: failed to set priority for 1 (process group ID): Operation not permitted $ renice 19 -u fra 1000 (user ID) old priority 0, new priority 19 Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* ipc: remove .info fileKarel Zak2010-12-031-1107/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: use GPLv2+Karel Zak2010-12-011-4/+5
| | | | | | | | | | | | | | CAI Qian and I agree that GPLv2+ is better for lscpu.c. This license is more compatible (than v3) with the rest of the util-linux package. We need to link the code with functions from lib/ -- mix GPLv3 and GPLv2 is bad idea. Note that it was only Cai and I who did significant changes to lscpu.c, all others changes from others developers was trivial (fix typos, add _(), ...). Signed-off-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* renice: rewrite usage()Karel Zak2010-11-301-12/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* renice: update man page (nice rlimit was added to kernel)Francesco Cosoleto2010-11-301-3/+3
| | | | | | | Non-root tasks can raise nice priority on systems running Linux 2.6.12 or higher if the nice resource limit is set. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* renice: reverse %s position in error messagesFrancesco Cosoleto2010-11-301-2/+2
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* renice: remove hardcoded program name using warn() and warnx()Francesco Cosoleto2010-11-301-10/+6Star
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* renice: make some functions staticFrancesco Cosoleto2010-11-301-3/+3
|
* rename util-linux-ng back to util-linuxKarel Zak2010-11-3022-43/+43
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: fix typoKarel Zak2010-11-291-1/+1
| | | | | Reported-by: Jeroen Oortwijn <oortwijn@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: use err.h routinesKarel Zak2010-11-262-71/+58Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: add 'show' mode for rtc alarmMarek Otahal2010-11-262-20/+94
| | | | | | | | | | The 'show' mode prints information on current alarm setting. [kzak@redhat.com: - code clean up - don't setup alarm on 'disable' mode] Signed-off-by: Marek Otahal <markotahal@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: add new commandLukas Czerner2010-11-264-3/+242
| | | | | | | | | fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-state drives (SSDs) and thinly-provisioned storage Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: fix typoKarel Zak2010-11-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] general purpose string handling functionsDavidlohr Bueso2010-11-232-2/+2
| | | | | | | | | | | | | This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* docs: remove ipc.texi (info with IPC API docs)Karel Zak2010-11-092-1315/+0Star
| | | | | | | The IPC API documentation is maintained in the standard man-pages. It does not make sense to maintain this docs in util-linux-ng. Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: make use xalloc wrappersDavidlohr Bueso2010-11-014-52/+21Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* ctrlaltdel: use err() instead of fprintf() and exit()Marek Polacek2010-10-211-29/+18Star
| | | | | | | | [kzak@redhat.com: - remove unnecessary program name from err(), - use program_invocation_short_name] Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: really use 'mode' argument in path_fopen()Petr Uzel2010-10-071-1/+1
|
* flock: use more useful example in flock.1Jakob Unterwurzacher2010-10-071-1/+1
| | | | | | | | The example in the man page does not prevent concurrent execution, as it obtains a shared lock. More useful is taking an exclusive lock, i.e. remove "-s". Additionally, IMO most people want the script to exit when the lock cannot be acquired, so adding "-n".
* fallocate: fix build failure with old linux headersMike Frysinger2010-10-071-1/+5
| | | | | | | | If linux/falloc.h does not exist, the build system still enables the fallocate util, but ultimately fails when it tries to include the header and use a define from it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* lscpu: update lscpu.1 to include new additions.Davidlohr Bueso2010-09-171-2/+2
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* lscpu: support sysfs without cpu/online fileKarel Zak2010-08-201-7/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add byte order and bogoMIPS informationDavidlohr Bueso2010-08-201-1/+12
| | | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* flock: properly report exec() errorsKarel Zak2010-08-201-1/+1
| | | | | Reported-by: Barry Davis <barry_davis@stormagic.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add -x and {On,Off}-line CPU(s) mask/listKarel Zak2010-08-112-17/+60
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: support offline CPUsKarel Zak2010-08-111-9/+52
| | | | | | | | | | | | | | | | | | | # echo 0 >/sys/devices/system/cpu/cpu3/online # echo 0 >/sys/devices/system/cpu/cpu2/online # grep processor /proc/cpuinfo processor : 0 processor : 1 # lscpu lscpu: error: cannot open /sys/devices/system/cpu/cpu2/cache/index0/shared_cpu_map: No such file or directory This patch also add a new "On-line CPU(s):" line to the lscpu(1) output. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=623012 Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: fix memory leak in dmesg(1).Davidlohr Bueso2010-08-041-2/+3
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* build-sys: man aliases don't depend on original man pageDiego Elio 'Flameeyes' Pettenò2010-07-291-1/+1
| | | | | | | Avoid rebuilding the man aliases over and over given that they do not copy the content but only alias it. Signed-off-by: Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
* build-sys: use the silent-rules prefix when generating man pages.Diego Elio 'Flameeyes' Pettenò2010-07-291-1/+1
| | | | | | | This is backward-compatible with automake 1.10 as the AM_V_GEN macro is going to be null anyway. Signed-off-by: Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>