[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1273222543-17083-9-git-send-email-jslaby@suse.cz>
Date: Fri, 7 May 2010 10:55:40 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: akpm@...ux-foundation.org
Cc: torvalds@...ux-foundation.org, adobriyan@...il.com,
nhorman@...driver.com, oleg@...hat.com,
linux-kernel@...r.kernel.org, jirislaby@...il.com
Subject: [PATCH 09/11] rlimits: switch getrlimit to do_prlimit
From: Jiri Slaby <jirislaby@...il.com>
After we added more generic do_prlimit, switch sys_getrlimit to that.
We now have all non-compat rlimit handling at one place.
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
kernel/sys.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index 7a453d2..0f8034f 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1236,15 +1236,14 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
{
- if (resource >= RLIM_NLIMITS)
- return -EINVAL;
- else {
- struct rlimit value;
- task_lock(current->group_leader);
- value = current->signal->rlim[resource];
- task_unlock(current->group_leader);
- return copy_to_user(rlim, &value, sizeof(*rlim)) ? -EFAULT : 0;
- }
+ struct rlimit value;
+ int ret;
+
+ ret = do_prlimit(current, resource, NULL, &value);
+ if (!ret)
+ ret = copy_to_user(rlim, &value, sizeof(*rlim)) ? -EFAULT : 0;
+
+ return ret;
}
#ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists