Hi all,
I hope this is the correct forum to ask this question. I have a question regarding process resource usage limitation via setrlimit() as it relates to RLIMIT_CPU. In the setrlimit manpage, it says the following about RLIMIT_CPU:
My question is, is this to be interpreted as total aggregate CPU usage time of the process or one-shot usage (i.e. if the process uses CPU for more than x secs uninterrupted, then send SIGXCPU)?
More concretely, the getty process sets a 60 second limit (GETTY_TIMEOUT=60) via below code, and I am trying to understand if getty will call timeoverrun signal handler when it has consumed 60 seconds of aggregate CPU time or 60 seconds at a single time.
Thank you in advance for you help in clarifying this point!
Raku
I hope this is the correct forum to ask this question. I have a question regarding process resource usage limitation via setrlimit() as it relates to RLIMIT_CPU. In the setrlimit manpage, it says the following about RLIMIT_CPU:
Code:RLIMIT_CPU The maximum amount of cpu time (in seconds) to be used by each process.
My question is, is this to be interpreted as total aggregate CPU usage time of the process or one-shot usage (i.e. if the process uses CPU for more than x secs uninterrupted, then send SIGXCPU)?
More concretely, the getty process sets a 60 second limit (GETTY_TIMEOUT=60) via below code, and I am trying to understand if getty will call timeoverrun signal handler when it has consumed 60 seconds of aggregate CPU time or 60 seconds at a single time.
Code:
/*
* Limit running time to deal with broken or dead lines.
*/
(void)signal(SIGXCPU, timeoverrun);
limit.rlim_max = RLIM_INFINITY;
limit.rlim_cur = GETTY_TIMEOUT;
(void)setrlimit(RLIMIT_CPU, &limit);
Thank you in advance for you help in clarifying this point!
Raku