summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* blkdiscard: slice up the recently changed usage textBenno Schulenberg2016-03-091-7/+8
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mount: further improve formatting of the man pageBenno Schulenberg2016-03-091-125/+118Star
| | | | | | | | | Mainly by using proper subsections (so they can be indexed), protecting some things from hyphenation, and marking with \& periods that don't end sentences. Tweaking some wordings too. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "include sysmacros.h where used"Karel Zak2016-03-082-2/+0Star
| | | | This reverts commit 46a40c018438b7b2b25083a5e5a4a21055a0c1e9.
* mount: adjust some wordings and formatting in the man pageBenno Schulenberg2016-03-081-29/+20Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* ctrlaltdel: tweak the wording in the man pageBenno Schulenberg2016-03-081-4/+5
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* losetup: correct some formatting in the man pageBenno Schulenberg2016-03-081-6/+8
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* mount: hardwrap an overlong example in the man pageBenno Schulenberg2016-03-081-1/+4
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fstrim: a few tiny tweaks of the man pageBenno Schulenberg2016-03-081-5/+5
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* include sysmacros.h where usedMike Frysinger2016-03-082-0/+2
| | | | | | | | BSD/Linux systems stick major/minor/makedev in sysmacros.h. Newer Linux libraries have been moving away from including sysmacros.h implicitly via sys/types.h, so include it directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* misc: never cast void* from malloc(3) and friendsRuediger Meier2016-03-071-2/+2
| | | | | | | | | | Such cast could hide serious compiler warnings in case we are missing includes (e.g. <stdlib.h> or "xalloc.h"). See http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: safer (and uniform) handling of return valueYuriy M. Kaminskiy2016-03-072-3/+7
| | | | | | When `rc` is `INT_MAX`, `rc + 1` result in signed integer overflow. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsns.c: fix error returnYuriy M. Kaminskiy2016-03-071-1/+1
| | | | | | | If non-negative value returned, errno could be unset (especially 0). Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix backward buffer size adjustment after adding delimiterYuriy M. Kaminskiy2016-03-071-2/+2
| | | | | | | remaining buffer space was increased after adding character, instead of decreasing Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'port-osx' of https://github.com/rudimeier/util-linuxKarel Zak2016-03-073-3/+0Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'port-osx' of https://github.com/rudimeier/util-linux: lib: include strutils.h for mempcpy() build-sys: remove duplicate cal sources lib: provide fallback if mkostemp(3) missing build-sys: chrt requires a sched_set* function build-sys: add --disable-ipcrm --disable-ipcs build-sys: disable login-utils if shadow.h or utmp.h is missing login-utils: minor utmp cleanup build-sys: build_init should check for flock newgrp: rename memset_s() misc: fix some includes libsmartcols: fix uninitialized variable fdisk: fix warning, incompatible pointer types passing 'uint64_t *' logger: use SCM_CREDENTIALS on LINUX only
| * misc: fix some includesRuediger Meier2016-02-293-3/+0Star
| | | | | | | | | | | | | | | | | | features.h: any glibc header includes this already libgen.h: was unused there sys/uio.h: for writev(3p) sys/queue.h seems like it was never used Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | setarch: fix personality syscall return code checkDmitry V. Levin2016-03-071-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on architecture and kernel version, personality syscall is either capable or incapable of returning an error. If the return value is not an error, then it's the previous personality value, which can be an arbitrary value undistinguishable from an error value. To make things clear, a second call is needed. For more details about personality syscall peculiarities see https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=glibc-2.22-637-ge0043e17dfc5 Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* | blkdiscard: add --zeroout (BLKZEROOUT ioctl)Karel Zak2016-02-242-14/+51
|/ | | | | Requested-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* unshare: add example for persistent mount namespaceKarel Zak2016-02-241-1/+18
| | | | | References: https://github.com/karelzak/util-linux/issues/289 Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: show gid instead of uidHushan Jia2016-02-221-3/+3
| | | | | | ipcs -i incorrectly used uid where it should be gid Signed-off-by: Hushan Jia <hushan.jia@gmail.com>
* hwclock: use labs() for longKarel Zak2016-02-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsns: use xcalloc()Ruediger Meier2016-02-181-2/+2
| | | | | | ... found by tools/checkxalloc.sh Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib: rename strmode() and setmode()Ruediger Meier2016-02-181-3/+3
| | | | | | On BSD they are part of the standard C library. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* unshare: fix busyloop and reduce racing probabilityYuriy M. Kaminskiy2016-02-171-10/+30
| | | | | | | | | | | | | | Replace busy-loop with waiting on pipe from parent. Note: reduces racing probability, but still there are window where it is possible (if parent unshare process will be [externally] killed between successful read(fds[0]) and mount() calls). [kzak@redhat.com: - use all-io.h to avoid loops around write() and read(), - use less generic 0x06 byte to sync parent and child] Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock.c, hwclock.8.in: new --show formatJ William Piggott2016-02-172-13/+12Star
| | | | | | | | | * hwclock.c: change --get and --show functions to the ISO 8601 format and concatenate fractional seconds to the time display. * hwclock.8.in: document this. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* misc: always cast timeval.tv_usec to long rather than intRuediger Meier2016-02-122-24/+26
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* ipcs: ulong -> unsigned longRuediger Meier2016-02-111-5/+5
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* swapon: drop perms if setuid before call mkswapKarel Zak2016-02-111-4/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: simplify ctl->device usageKarel Zak2016-02-111-43/+37Star
| | | | | | | * use and initialize ctl->{label,uuid,device} by do_swapon() only * remove ctl->canonic, function arguments are good enough for this Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: do not run execvp() calls when swapon is setuid binarySami Kerola2016-02-111-0/+4
| | | | | | | | swapon(8) is not expected to be setuid binary, but if it is try to avoid obvious security vulnerability of executing user preferred mkswap file as someone else, such as root. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* swapon: move function arguments to control structureSami Kerola2016-02-111-81/+77Star
| | | | | | | | This makes reading what the code does easier. This change also makes error messages to prefer none-canonical device path, e.g., the one user supplied rather than the canonical path needed internally. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* swapon: add control structSami Kerola2016-02-111-124/+129
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hwclock: remove extra space from --show outputKarel Zak2016-02-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Change of output format and documentation.Anna Jonna Ármannsdóttir2016-01-282-2/+6
|
* zramctl: fix typoKarel Zak2016-01-211-1/+1
| | | | | Reported-by: Rafael Fontenelle <rffontenelle@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: allow nofail to silence ENOMEDIUM casesMike Frysinger2016-01-211-0/+3
| | | | | | | | Allow people to use nofail to ignore empty cd/dvd drive errors. URL: https://bugs.gentoo.org/559356 Reported-by: William Hubbs <williamh@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* chrt: make man page more structuredKarel Zak2016-01-201-120/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix format specifier [cppcheck]Boris Egorov2016-01-191-1/+1
| | | | [sys-utils/hwclock-rtc.c:435]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'.
* readprofile: add scanf field width limits [cppcheck]Boris Egorov2016-01-191-2/+2
| | | | | [sys-utils/readprofile.c:301]: (warning) scanf without field width limits can crash with huge input data. [sys-utils/readprofile.c:322]: (warning) scanf without field width limits can crash with huge input data.
* lsns: fix failure after zombie processYuriy M. Kaminskiy2016-01-181-1/+1
| | | | | (At least on kernel 3.16), stat("/proc/${pid_of_zombie}/ns/mnt") returns -ENOENT, as a result lsns stops scanning processes prematurely.
* fstrim: add reference to blkdiscardKarel Zak2016-01-131-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: systemd timer units should be WantedBy=timers.targetPeter Hoeg2016-01-121-1/+1
| | | | | | [kzak@redhat.com: - this configuration is recommended by systemd docs] Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: change audit messageKarel Zak2016-01-071-1/+1
| | | | | | | The preferred layout is name=value for audit messages. References: https://bugzilla.redhat.com/show_bug.cgi?id=1296278 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount.8: Add documentation of overlay mount optionsOsamu Aoki2016-01-051-0/+35
| | | | | | [kzak@redhat.com: - add more information, change formatting] Signed-off-by: Karel Zak <kzak@redhat.com>
* lsns: Fix "lowers" -> "lowest" typo in --help for COL_PIDW. Trevor King2016-01-051-1/+1
| | | | | | | | | | | The process-selection logic is in add_process_to_namespace: if (!ns->proc || ns->proc->pid > proc->pid) ns->proc = proc; so it's just selecting the lowest PID. Signed-off-by: W. Trevor King <wking@tremily.us>
* blkdiscard: don't report "zero range" at the endRuediger Meier2015-12-091-1/+1
| | | | | | | | | | | | | | | We want to address the case that we have printed the last useful stats line already within the loop. Avoiding an additional line "Discarded 0 bytes ..." at the end. Note there is a behavior change now for the edge cases "-v -l 0" and "-v -o blksize" where we don't print any stats line anymore. But actually it's correct, we never make any BLKDISCARD syscall with zero range. Perhaps we should return error in these cases to help people who always want to parse stats output on success. CC: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* blkdiscard: fix stats reporting (off by one)Ruediger Meier2015-12-091-3/+3
| | | | | CC: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* blkdiscard: fix timeval comparison inclusive usecsRuediger Meier2015-12-091-2/+3
| | | | | | | We will see if this makes our "--step" tests reliable. CC: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Fix subtle typofREW Schmidt2015-12-071-1/+1
|
* lsns: improve formatting and wording of the man pageBenno Schulenberg2015-12-041-17/+14Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* lscpu: Print physical cpu informationSukadev Bhattiprolu2015-12-023-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lscpu currently prints information for CPUs configured in the system. In case of KVM or other virtualized guest operating systems, this refers to the virtual system, and bears no relation to the physical topology of the system. It would be useful if lscpu could also display the physical topology info when available: $ ./lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 16 NUMA node(s): 1 Model: IBM pSeries (emulated by qemu) Hypervisor vendor: KVM Virtualization type: para L1d cache: 64K L1i cache: 32K NUMA node0 CPU(s): 0-15 Physical sockets: 2 <<< New Physical chips: 4 <<< New Physical cores/chip: 4 <<< New For now, physical topology information is available on platforms that support the following RTAS (Real time abstraction service) call provided by librtas: rtas_get_sysparm(PROCESSOR_MODULE_INFO). Currently this call is available to the PowerVM (pHYP) guests on PowerPC. With a patch propoosed to PowerKVM, this RTAS call would also be available to PowerKVM guests. Based on input from Nishanth Aravamudan and Karel Zak. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>