Re: [PATCH v3 10/11] rlimits: implement prlimit64 syscall

From: Andrew Morton
Date: Wed May 26 2010 - 10:31:42 EST


On Wed, 26 May 2010 14:58:05 +0200 Jiri Slaby <jirislaby@xxxxxxxxx> wrote:

> > This could all be done in userspace, couldn't it? Write a little library
> > which clones a thread then waits for someone to send it a
> > change-your-rlimits message. Write a little tool to send those
> > messages and voila.
>
> Sorry, I'm not sure I understand this. Could you shed some light on what
> will run in the new thread?
>
> A code such as:
> main()
> {
> if (!clone())
> exec("something");
>
> while (wait_for_message(&m)) {
> setrlimit(m);
> sleep();
> }
> }
> won't obviously work. Could you change it so it reflects your idea or
> explain what I'm missing?

main()
{
if (clone(...)) {
while (wait_for_message(&m))
setrlimit(m);
}

...
}

?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/