Changing CPU limits
Eddie Wyatt
edw at IUS1.CS.CMU.EDU
Wed Mar 23 09:01:55 AEST 1988
> It appears that ULTRIX determines the cpu limit for a process at process
> creation. I can use the "limit" command to change my cpu limit for the
> current process (csh) and any future processes. My question: is there
> a way to modify this limit once the process is already running? Then if a
> process I had running in the background was approaching its cpu limit, I
> could up the limit and avoid having to restart the process from scratch.
> Any ideas would be appreciated. Thanks.
{
struct rlimit rlp;
getrlimit(RLIMIT_CPU,&rlp);
rlp.rlim_cur = rlp.rlim_max;
setrlimit(RLIMIT_CPU,&rlp);
}
This will set the cpu limit to the hard limit (can't go high unless your root).
--
Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu
More information about the Comp.unix.questions
mailing list