Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.unix.questions Subject: Re: Changing CPU limits Message-ID: <1198@PT.CS.CMU.EDU> Date: 22 Mar 88 23:01:55 GMT References: <12569@brl-adm.ARPA> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 23 > 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@ius1.cs.cmu.edu