spraff
spraff

Reputation: 33395

setrlimit on another process

I know I can use setrlimit to limit the resources my program can use, but if my program launches another process, how can I set corresponding limits on that other process?

N.. Yes, I could lower my own (hard) limits and then fork, but being unprivileged, would not be able to put my own limits back up again. This is not a solution.

Upvotes: 1

Views: 1185

Answers (1)

trojanfoe
trojanfoe

Reputation: 122391

You fork() first and then call setrlimit() before exec().

Upvotes: 6

Related Questions