Messages in this thread | | | Date | Sun, 21 Mar 2010 11:38:08 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [git pull] pull request for writable limits for 2.6.34-rc0 |
| |
On Sun, 21 Mar 2010, Alexey Dobriyan wrote: > > It's a perfect opportunity to introduce getrlimit64(2), setrlimit64(2) > _without_ involving /proc, without all bugs in setrlimit(2), without > compat code, with all resources equal across arches, and, optionally, > with infinity setting clearly separate from value (useful for C/R).
Yeah, the infinity setting should be cleaned up. I also wonder if we should clean up the odd file limit rules, and make them all be about bytes. Correct me if I'm wrong, but don't we do that whole file size thing in kilobytes right now?
I do also agree that maybe we could/should skip the whole "writable /proc" thing.
So introducing it as just two system calls:
int getprlimit64(pid, limit, struct rlimit64 *); int setprlimit64(pid, limit, const struct rlimit64 *);
and having perhaps something like 'pid=0 means current' would look a lot prettier to me.
Or even just _one_ system call that takes two pointers, and can do an atomic replace-and-return-the-old-value, like 'sigaction()' does, ie something like
int prlimit64(pid, limit, const struct rlimit64 *new, struct rlimit64 *old);
wouldn't that be a nice generic interface?
(Somebody should really check me on the whole "limit in kilobytes" thing - I may be _totally_ off there. I am too lazy to check the actual source code)
Linus
| |