summaryrefslogtreecommitdiffstats
path: root/sys-utils/prlimit.c
Commit message (Collapse)AuthorAgeFilesLines
* prlimit: delete rem_prlim prototypeDavidlohr Bueso2013-05-061-12/+8Star
| | | | | | We can just move the function up before any of its callers. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* translation: unify exec error messagesSami Kerola2013-02-061-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* prlimit: don't care about xasprintf() return codeKarel Zak2012-12-121-8/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: improve error messages for bad --pid invocationBernhard Voelker2012-07-261-2/+2
| | | | Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* prlimit: use err_exclusive_options()Karel Zak2012-07-261-10/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: use exclusive_option()Sami Kerola2012-06-171-6/+10
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sys-utils: cleanup strtoxx_or_err()Karel Zak2012-05-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: remove bogus instructionsDavidlohr Bueso2012-04-231-2/+0Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* xalloc: use xasprintf in all filesSami Kerola2012-03-181-6/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* prlimit: use xalloc libsDavidlohr Bueso2011-12-201-1/+1
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* prlimit: return proper typeDavidlohr Bueso2011-12-161-1/+1
| | | | | | The add_prlim() function's definition currently returns a bogus structure. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* prlimit: s/amount/number/Jim Meyering2011-11-231-5/+5
|
* prlimit: add support for executing a commandBernhard Voelker2011-11-231-4/+13
| | | | | | | | | prlimit.c: Alternatively to applying the limits to an existing process via the --pid option, allow a command to be executed. Adapted usage() accordingly. prlimit.1: mention new syntax. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* prlimit: don't share pointer for old and new in prlimit(2)Karel Zak2011-11-161-3/+4
| | | | | | | | This patch makes the code more robust. We should not share the same pointer for old and new arguments for prlimit(2) syscall. Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: avoid segfault due to array-out-of-bounds errorKarel Zak2011-11-161-39/+63
| | | | | | | | | | | | | Example: $ prlimit -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l RESOURCE DESCRIPTION SOFT HARD UNITS MEMLOCK max locked-in-memory address space 65536 262144 bytes MEMLOCK max locked-in-memory address space 65536 262144 bytes ... Segmentation fault Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: replace lims[i] with pointerKarel Zak2011-11-161-12/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: fix case when PID is given laterBernhard Voelker2011-11-161-29/+33
| | | | | | | | | | | | | | | | | | | # prlimit --nofile=:4000 --pid $$ When the PID is given later than a partially given limit, then prlimit used the current PID for getting the missing part (hard, soft) of the limit. Factored out the retrieval of the unknown limit from parse_prlim() to new get_unknown_hardsoft() which is to be called by do_prlimit() based on the struct prlimit member 'modify' set by add_prlim(). [kzak@redhat.com: - use prlimit->mofify as mask - add soft vs. hard limit check from another Bernhard's patch] Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: fix error messageKarel Zak2011-11-161-2/+4
| | | | | | | | | | - differentiate between set and get operations - add limit name to the error message - remove PID from the message (whole util works always with only one PID, so this info is superfluous) Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: show all limits if called without optionsBernhard Voelker2011-11-161-2/+1Star
| | | | | | | | Fix option parsing: prlimit ran into usage() if called without arguments which should only be done for surplus arguments. Instead, it should display all limits. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* prlimit: fix SYS_ macroKarel Zak2011-11-091-1/+1
| | | | | Reported-by: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: add --{raw,noheadings} optionsKarel Zak2011-11-071-7/+21
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: add a units columnDavidlohr Bueso2011-11-071-16/+23
| | | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: add add falbacksKarel Zak2011-11-031-0/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: new commandDavidlohr Bueso2011-10-211-0/+571
This program uses the prlimit() system call to get and/or set resource limits for a given process. [kzak@redhat,com: - improve <soft:hard> parsing, - use short cmdline options compatible with ulimits - add --verbose mode - fix gcc warnings] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>