Lines Matching refs:Pr
83 struct ps_prochandle *Pr; in main() local
145 if ((Pr = proc_arg_xgrab(arg, NULL, PR_ARG_CORES, in main()
159 Prelease(Pr, 0); in main()
165 show_files(Pr); in main()
166 Prelease(Pr, 0); in main()
168 } else if ((Pr = Pgrab(pid, Fflag, &gret)) != NULL) { in main()
169 if (Pcreate_agent(Pr) == 0) { in main()
173 show_files(Pr); in main()
174 Pdestroy_agent(Pr); in main()
181 Prelease(Pr, 0); in main()
182 Pr = NULL; in main()
219 struct ps_prochandle *Pr = data; in show_file() local
269 dofcntl(Pr, info, in show_file()
273 if (Pstate(Pr) != PS_DEAD) { in show_file()
277 dosocket(Pr, info->pr_fd); in show_file()
279 dofifo(Pr, info->pr_fd); in show_file()
297 dotli(Pr, info->pr_fd); in show_file()
316 show_files(struct ps_prochandle *Pr) in show_files() argument
320 if (pr_getrlimit(Pr, RLIMIT_NOFILE, &rlim) == 0) { in show_files()
330 (void) Pfdinfo_iter(Pr, show_file, Pr); in show_files()
335 getflock(struct ps_prochandle *Pr, int fd, struct flock *flock_native) in getflock() argument
341 if (Pstatus(Pr)->pr_dmodel == PR_MODEL_ILP32) { in getflock()
343 ret = pr_fcntl(Pr, fd, F_GETLK, &flock_target); in getflock()
348 ret = pr_fcntl(Pr, fd, F_GETLK, flock_native); in getflock()
354 dofcntl(struct ps_prochandle *Pr, prfdinfo_t *info, int mandatory, int isdoor) in dofcntl() argument
372 if (isdoor && (Pstate(Pr) != PS_DEAD)) in dofcntl()
373 show_door(Pr, fd); in dofcntl()
375 } else if (isdoor && (Pstate(Pr) != PS_DEAD)) { in dofcntl()
377 show_door(Pr, fd); in dofcntl()
387 if ((Pstate(Pr) != PS_DEAD) && (getflock(Pr, fd, &flock) != -1)) { in dofcntl()
479 show_door(struct ps_prochandle *Pr, int fd) in show_door() argument
483 if (pr_door_info(Pr, fd, &door_info) != 0) in show_door()
601 show_sockopts(struct ps_prochandle *Pr, int fd) in show_sockopts() argument
636 if (pr_getsockopt(Pr, fd, boolopts[i].level, boolopts[i].opt, in show_sockopts()
642 if (pr_getsockopt(Pr, fd, SOL_SOCKET, SO_LINGER, &l, &vlen) == 0 && in show_sockopts()
650 if (pr_getsockopt(Pr, fd, SOL_SOCKET, SO_SNDBUF, &val, &vlen) == 0) { in show_sockopts()
655 if (pr_getsockopt(Pr, fd, SOL_SOCKET, SO_RCVBUF, &val, &vlen) == 0) { in show_sockopts()
660 if (pr_getsockopt(Pr, fd, IPPROTO_IP, IP_NEXTHOP, &nexthop_val, in show_sockopts()
678 show_sockfilters(struct ps_prochandle *Pr, int fd) in show_sockfilters() argument
691 if (pr_getsockopt(Pr, fd, SOL_FILTER, FIL_LIST, fi, &len) != 0) in show_sockfilters()
742 dopeerucred(struct ps_prochandle *Pr, int fd) in dopeerucred() argument
746 if (pr_getpeerucred(Pr, fd, &peercred) == 0) { in dopeerucred()
754 dosocket(struct ps_prochandle *Pr, int fd) in dosocket() argument
764 if (pr_getsockopt(Pr, fd, SOL_SOCKET, SO_TYPE, &type, &tlen) == 0) in dosocket()
767 show_sockopts(Pr, fd); in dosocket()
768 show_sockfilters(Pr, fd); in dosocket()
771 if (pr_getsockname(Pr, fd, sa, &len) == 0) in dosocket()
775 if (pr_getpeername(Pr, fd, sa, &len) == 0) in dosocket()
778 dopeerucred(Pr, fd); in dosocket()
783 dofifo(struct ps_prochandle *Pr, int fd) in dofifo() argument
785 dopeerucred(Pr, fd); in dofifo()
790 dotli(struct ps_prochandle *Pr, int fd) in dotli() argument
798 if (pr_ioctl(Pr, fd, _I_CMD, &strcmd, sizeof (strcmd)) == 0) in dotli()
802 if (pr_ioctl(Pr, fd, _I_CMD, &strcmd, sizeof (strcmd)) == 0) in dotli()