Lines Matching refs:Pr
94 struct ps_prochandle *Pr; in main() local
178 } else if ((Pr = Pgrab(pid, Fflag, &gret)) != NULL) { in main()
179 if (Pcreate_agent(Pr) == 0) { in main()
181 if (set_limits(Pr) != 0) in main()
187 show_limits(Pr); in main()
189 Pdestroy_agent(Pr); in main()
196 Prelease(Pr, 0); in main()
388 show_limits(struct ps_prochandle *Pr) in show_limits() argument
398 if (pr_getrlimit64(Pr, resource, &rlim) != 0) in show_limits()
470 set_one_limit(struct ps_prochandle *Pr, int which, rlim64_t cur, rlim64_t max) in set_one_limit() argument
478 if (pr_getrlimit64(Pr, which, &rlim) != 0) { in set_one_limit()
481 command, Pstatus(Pr)->pr_pid, strerror(errno)); in set_one_limit()
493 if (max > rlim.rlim_max && Pr != NULL) in set_one_limit()
499 new_prpriv = proc_get_priv(Pstatus(Pr)->pr_pid); in set_one_limit()
503 " %d: %s\n", command, Pstatus(Pr)->pr_pid, in set_one_limit()
522 old_prpriv = proc_get_priv(Pstatus(Pr)->pr_pid); in set_one_limit()
528 Pstatus(Pr)->pr_pid, strerror(errno)); in set_one_limit()
535 if (Psetflags(Pr, PR_KLC) != 0 || in set_one_limit()
536 Psetpriv(Pr, new_prpriv) != 0) { in set_one_limit()
540 Pstatus(Pr)->pr_pid, strerror(errno)); in set_one_limit()
541 (void) Punsetflags(Pr, PR_KLC); in set_one_limit()
549 if (pr_setrlimit64(Pr, which, &rlim) != 0) { in set_one_limit()
552 command, Pstatus(Pr)->pr_pid, strerror(errno)); in set_one_limit()
557 if (Psetpriv(Pr, old_prpriv) != 0) { in set_one_limit()
564 Pdestroy_agent(Pr); in set_one_limit()
568 command, Pstatus(Pr)->pr_pid); in set_one_limit()
571 if (Punsetflags(Pr, PR_KLC) != 0) { in set_one_limit()
575 command, Pstatus(Pr)->pr_pid); in set_one_limit()
589 set_limits(struct ps_prochandle *Pr) in set_limits() argument
596 if (set_one_limit(Pr, which, rlimit[which].rlim_cur, in set_limits()