diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-05-04 18:03:50 +0200 |
---|---|---|
committer | Jiri Slaby <jirislaby@gmail.com> | 2010-07-16 09:48:48 +0200 |
commit | c022a0acad534fd5f5d5f17280f6d4d135e74e81 (patch) | |
tree | b67cb6f1dd5ca1625b3699577b781d8058a37e93 /include/linux/smb_fs_sb.h | |
parent | b95183453af2ed14a5c7027e58049c9fd17e92ce (diff) | |
download | kernel_samsung_smdk4412-c022a0acad534fd5f5d5f17280f6d4d135e74e81.zip kernel_samsung_smdk4412-c022a0acad534fd5f5d5f17280f6d4d135e74e81.tar.gz kernel_samsung_smdk4412-c022a0acad534fd5f5d5f17280f6d4d135e74e81.tar.bz2 |
rlimits: implement prlimit64 syscall
This patch adds the code to support the sys_prlimit64 syscall which
modifies-and-returns the rlim values of a selected process atomically.
The first parameter, pid, being 0 means current process.
Unlike the current implementation, it is a generic interface,
architecture indepentent so that we needn't handle compat stuff
anymore. In the future, after glibc start to use this we can deprecate
sys_setrlimit and sys_getrlimit in favor to clean up the code finally.
It also adds a possibility of changing limits of other processes. We
check the user's permissions to do that and if it succeeds, the new
limits are propagated online. This is good for large scale
applications such as SAP or databases where administrators need to
change limits time by time (e.g. on crashes increase core size). And
it is unacceptable to restart the service.
For safety, all rlim users now either use accessors or doesn't need
them due to
- locking
- the fact a process was just forked and nobody else knows about it
yet (and nobody can't thus read/write limits)
hence it is safe to modify limits now.
The limitation is that we currently stay at ulong internal
representation. So the rlim64_is_infinity check is used where value is
compared against ULONG_MAX on 32-bit which is the maximum value there.
And since internally the limits are held in struct rlimit, converters
which are used before and after do_prlimit call in sys_prlimit64 are
introduced.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'include/linux/smb_fs_sb.h')
0 files changed, 0 insertions, 0 deletions