diff options
author | Karel Zak | 2011-10-28 00:23:59 +0200 |
---|---|---|
committer | Karel Zak | 2011-11-03 12:32:51 +0100 |
commit | 945ac25080493126d094731510b85bc2d90a1170 (patch) | |
tree | 15e92f972f9b46aff984477bebaf5e89eb284561 /sys-utils/prlimit.c | |
parent | libuuid: fix includes in man pages (diff) | |
download | kernel-qcow2-util-linux-945ac25080493126d094731510b85bc2d90a1170.tar.gz kernel-qcow2-util-linux-945ac25080493126d094731510b85bc2d90a1170.tar.xz kernel-qcow2-util-linux-945ac25080493126d094731510b85bc2d90a1170.zip |
prlimit: add add falbacks
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/prlimit.c')
-rw-r--r-- | sys-utils/prlimit.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index 74c7fc98e..2c7e6635e 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -33,6 +33,10 @@ #include "xalloc.h" #include "strutils.h" +#ifndef RLIMIT_RTTIME +# define RLIMIT_RTTIME 15 +#endif + enum { AS, CORE, @@ -123,6 +127,16 @@ static int columns[NCOLS], ncolumns; static pid_t pid; /* calling process (default) */ static int verbose; +#ifndef HAVE_PRLIMIT +# include <sys/syscall.h> +static int prlimit(pid_t p, int resource, + const struct rlimit *new_limit, + struct rlimit *old_limit) +{ + return syscall(SYS_prlimit, p, resource, new_limit, old_limit); +} +#endif + static void __attribute__ ((__noreturn__)) usage(FILE * out) { size_t i; |