Lines Matching refs:pri
113 private_t *pri = NULL; in get_private() local
116 pri = value; in get_private()
117 if (pri == NULL) { in get_private()
118 pri = my_malloc(sizeof (*pri), NULL); in get_private()
119 (void) memset(pri, 0, sizeof (*pri)); in get_private()
120 pri->sys_path = my_malloc(pri->sys_psize = 16, NULL); in get_private()
121 pri->sys_string = my_malloc(pri->sys_ssize = 32, NULL); in get_private()
122 if (thr_setspecific(private_key, pri) == ENOMEM) in get_private()
125 return (pri); in get_private()
132 private_t *pri = value; in free_private() local
134 if (pri->sys_path) in free_private()
135 free(pri->sys_path); in free_private()
136 if (pri->sys_string) in free_private()
137 free(pri->sys_string); in free_private()
138 if (pri->exec_string) in free_private()
139 free(pri->exec_string); in free_private()
140 if (pri->str_buffer) in free_private()
141 free(pri->str_buffer); in free_private()
142 free(pri); in free_private()
254 private_t *pri; in main() local
298 pri = get_private(); in main()
382 if (siglist(pri, optarg, &signals, &sflag)) in main()
386 if (siglist(pri, optarg, &sighang, &Sflag)) in main()
509 pri->lwpstat = Lsp; in main()
512 make_pname(pri, 0); in main()
513 (void) sysentry(pri, 1); in main()
514 pri->length = 0; in main()
516 pri->exec_string = my_realloc(pri->exec_string, in main()
517 strlen(pri->sys_string) + 1, NULL); in main()
518 (void) strcpy(pri->exec_pname, pri->pname); in main()
519 (void) strcpy(pri->exec_string, pri->sys_string); in main()
520 pri->length += strlen(pri->sys_string); in main()
521 pri->exec_lwpid = pri->lwpstat->pr_lwpid; in main()
522 pri->sys_leng = 0; in main()
523 *pri->sys_string = '\0'; in main()
525 pri->syslast = Psp->pr_stime; in main()
526 pri->usrlast = Psp->pr_utime; in main()
608 show_cred(pri, TRUE, FALSE); in main()
614 if (grabit(pri, &grab[i++])) { in main()
642 if (grabit(pri, set)) { in main()
667 psargs(pri); in main()
789 private_t *pri = get_private(); in main_thread() local
844 letgo(pri); in main_thread()
858 report(pri, times(&tms) - starttime); in main_thread()
876 private_t *pri = get_private(); in worker_thread() local
890 pri->Lwp = Lwp; in worker_thread()
891 pri->lwpstat = Lsp; in worker_thread()
892 pri->syslast = Lsp->pr_stime; in worker_thread()
893 pri->usrlast = Lsp->pr_utime; in worker_thread()
894 make_pname(pri, 0); in worker_thread()
934 req_flag = jobcontrol(pri, dotrace); in worker_thread()
936 req_flag = requested(pri, req_flag, in worker_thread()
970 pri->Lwp = Lwp = in worker_thread()
975 pri->lwpstat = Lsp = Lstatus(Lwp); in worker_thread()
981 if (pri->exec_string && *pri->exec_string) { in worker_thread()
982 if (pri->exec_pname[0] != '\0') in worker_thread()
983 (void) fputs(pri->exec_pname, stdout); in worker_thread()
984 timestamp(pri); in worker_thread()
985 (void) fputs(pri->exec_string, stdout); in worker_thread()
987 } else if (pri->length) { in worker_thread()
990 if (pri->sys_valid) in worker_thread()
993 pri->pname, pri->sys_path); in worker_thread()
997 pri->pname); in worker_thread()
998 pri->length = 0; in worker_thread()
1006 abend(pri->pname, "uncaught status of subject lwp"); in worker_thread()
1009 make_pname(pri, 0); in worker_thread()
1020 req_flag = signalled(pri, req_flag, dotrace); in worker_thread()
1029 rval = function_trace(pri, first, 0, dotrace); in worker_thread()
1035 if (faulted(pri, dotrace) && in worker_thread()
1040 req_flag = jobcontrol(pri, dotrace); in worker_thread()
1046 pri->length = 0; in worker_thread()
1073 &Lsp->pr_stime, &pri->syslast); in worker_thread()
1075 &Lsp->pr_utime, &pri->usrlast); in worker_thread()
1076 pri->syslast = Lsp->pr_stime; in worker_thread()
1077 pri->usrlast = Lsp->pr_utime; in worker_thread()
1080 putpname(pri); in worker_thread()
1081 timestamp(pri); in worker_thread()
1085 pri->syslast = Lsp->pr_stime; in worker_thread()
1103 ow_subcode = getsubcode(pri); in worker_thread()
1104 pri->syslast = Lsp->pr_stime; in worker_thread()
1110 (void) sysentry(pri, dotrace); in worker_thread()
1113 strlen(pri->sys_string) + 1, NULL); in worker_thread()
1115 pri->sys_string); in worker_thread()
1119 pri->syslast = Lsp->pr_stime; in worker_thread()
1122 (void) sysentry(pri, dotrace); in worker_thread()
1123 putpname(pri); in worker_thread()
1124 timestamp(pri); in worker_thread()
1125 pri->length += in worker_thread()
1126 printf("%s\n", pri->sys_string); in worker_thread()
1129 pri->sys_leng = 0; in worker_thread()
1130 *pri->sys_string = '\0'; in worker_thread()
1136 show_cred(pri, FALSE, TRUE); in worker_thread()
1137 (void) sysentry(pri, dotrace); in worker_thread()
1140 pri->exec_string = in worker_thread()
1141 my_realloc(pri->exec_string, in worker_thread()
1142 strlen(pri->sys_string) + 1, in worker_thread()
1144 (void) strcpy(pri->exec_pname, in worker_thread()
1145 pri->pname); in worker_thread()
1146 (void) strcpy(pri->exec_string, in worker_thread()
1147 pri->sys_string); in worker_thread()
1148 pri->length += strlen(pri->sys_string); in worker_thread()
1149 pri->exec_lwpid = Lsp->pr_lwpid; in worker_thread()
1151 pri->sys_leng = 0; in worker_thread()
1152 *pri->sys_string = '\0'; in worker_thread()
1157 pri->syslast = Lsp->pr_stime; in worker_thread()
1172 (void) sysentry(pri, dotrace); in worker_thread()
1173 pri->Errno = Lsp->pr_errno; in worker_thread()
1174 pri->ErrPriv = Lsp->pr_errpriv; in worker_thread()
1178 pri->sys_nargs > 2 && in worker_thread()
1179 (pri->sys_args[2]&0x3) == O_RDONLY) || in worker_thread()
1182 pri->sys_nargs > 1 && in worker_thread()
1183 (pri->sys_args[1]&0x3) == O_RDONLY); in worker_thread()
1184 if ((pri->Errno == 0 || pri->Errno == EBUSY) && in worker_thread()
1185 pri->sys_valid && !readonly) { in worker_thread()
1186 int rv = checkproc(pri); in worker_thread()
1196 putpname(pri); in worker_thread()
1197 timestamp(pri); in worker_thread()
1199 pri->sys_string); in worker_thread()
1213 pri->sys_leng = 0; in worker_thread()
1214 *pri->sys_string = '\0'; in worker_thread()
1215 pri->sys_nargs = 0; in worker_thread()
1231 if (sysexit(pri, dotrace)) in worker_thread()
1233 if (what == SYS_lwp_create && pri->Rval1 != 0) { in worker_thread()
1237 if ((new_Lwp = grab_lwp(pri->Rval1)) != NULL) { in worker_thread()
1251 pri->sys_nargs = 0; in worker_thread()
1255 if (what == SYS_execve && pri->Errno == 0) { in worker_thread()
1275 pri->Lwp = Lwp = in worker_thread()
1280 pri->lwpstat = Lsp = Lstatus(Lwp); in worker_thread()
1292 if (pri->child) { /* controlled process fork()ed */ in worker_thread()
1301 if (control(pri, pri->child)) { in worker_thread()
1303 pri->child = 0; in worker_thread()
1328 pri->child = 0; in worker_thread()
1362 pri->pname); in worker_thread()
1411 (void) function_trace(pri, 0, 1, dotrace); in worker_thread()
1422 &Lsp->pr_stime, &pri->syslast); in worker_thread()
1424 &Lsp->pr_utime, &pri->usrlast); in worker_thread()
1425 pri->syslast = Lsp->pr_stime; in worker_thread()
1426 pri->usrlast = Lsp->pr_utime; in worker_thread()
1429 putpname(pri); in worker_thread()
1430 timestamp(pri); in worker_thread()
1434 pri->syslast = Lsp->pr_stime; in worker_thread()
1850 make_pname(private_t *pri, id_t tid) in make_pname() argument
1856 id_t lwpid = pri->lwpstat->pr_lwpid; in make_pname()
1858 if (ff != pri->pparam.ff || in make_pname()
1859 lf != pri->pparam.lf || in make_pname()
1860 pid != pri->pparam.pid || in make_pname()
1861 lwpid != pri->pparam.lwpid || in make_pname()
1862 tid != pri->pparam.tid) { in make_pname()
1863 char *s = pri->pname; in make_pname()
1873 if (ff && lf && s < pri->pname + 9) in make_pname()
1876 pri->pparam.ff = ff; in make_pname()
1877 pri->pparam.lf = lf; in make_pname()
1878 pri->pparam.pid = pid; in make_pname()
1879 pri->pparam.lwpid = lwpid; in make_pname()
1880 pri->pparam.tid = tid; in make_pname()
1889 putpname(private_t *pri) in putpname() argument
1891 if (pri->pname[0]) in putpname()
1892 (void) fputs(pri->pname, stdout); in putpname()
1899 timestamp(private_t *pri) in timestamp() argument
1901 const lwpstatus_t *Lsp = pri->lwpstat; in timestamp()
1925 int oseconds = pri->seconds; in timestamp()
1926 int ofraction = pri->fraction; in timestamp()
1928 pri->seconds = seconds; in timestamp()
1929 pri->fraction = fraction; in timestamp()
1940 seconds = Lsp->pr_stime.tv_sec - pri->syslast.tv_sec; in timestamp()
1941 fraction = Lsp->pr_stime.tv_nsec - pri->syslast.tv_nsec; in timestamp()
2088 report(private_t *pri, time_t lapse) /* elapsed time, clock ticks */ in report() argument
2108 name = proc_fltname(i, pri->flt_name, in report()
2109 sizeof (pri->flt_name)); in report()
2125 name = signame(pri, i); in report()
2179 sysname(pri, i, subcode)); in report()
2268 psargs(private_t *pri) in psargs() argument
2275 pri->pname, psinfo.pr_psargs); in psargs()
2279 pri->pname, (int)pid); in psargs()
2284 fetchstring(private_t *pri, long addr, int maxleng) in fetchstring() argument
2291 if (pri->str_bsize == 0) /* initial allocation of string buffer */ in fetchstring()
2292 pri->str_buffer = in fetchstring()
2293 my_malloc(pri->str_bsize = 16, "string buffer"); in fetchstring()
2294 *pri->str_buffer = '\0'; in fetchstring()
2298 return (leng? pri->str_buffer : NULL); in fetchstring()
2301 while (leng + nbyte >= pri->str_bsize) in fetchstring()
2302 pri->str_buffer = in fetchstring()
2303 my_realloc(pri->str_buffer, in fetchstring()
2304 pri->str_bsize *= 2, "string buffer"); in fetchstring()
2305 (void) strcpy(pri->str_buffer+leng, string); in fetchstring()
2312 pri->str_buffer[leng] = '\0'; in fetchstring()
2314 return (pri->str_buffer); in fetchstring()
2325 show_cred(private_t *pri, int new, int loadonly) in show_cred() argument
2332 (void) printf("%s\t*** Cannot get credentials\n", pri->pname); in show_cred()
2337 (void) printf("%s\t*** Cannot get privileges\n", pri->pname); in show_cred()
2349 pri->pname, in show_cred()
2358 pri->pname, in show_cred()
2373 pri->pname, in show_cred()
2392 control(private_t *pri, pid_t pid) in control() argument
2406 pri->pname, (int)pid); in control()
2411 release(pri, pid); in control()
2472 pri->lwpstat = Lsp; in control()
2475 make_pname(pri, 0); in control()
2477 pri->syslast = Psp->pr_stime; in control()
2478 pri->usrlast = Psp->pr_utime; in control()
2492 grabit(private_t *pri, proc_set_t *set) in grabit() argument
2504 pri->lwpstat = NULL; in grabit()
2509 pri->lwpstat = Lsp; in grabit()
2511 make_pname(pri, 0); in grabit()
2514 pri->syslast = Psp->pr_stime; in grabit()
2515 pri->usrlast = Psp->pr_utime; in grabit()
2522 show_cred(pri, TRUE, FALSE); in grabit()
2530 release(private_t *pri, pid_t pid) in release() argument
2550 pri->pname, (int)pid); in release()
2571 private_t *pri; in intr() local
2575 (pri = value) != NULL && in intr()
2576 (Lwp = pri->Lwp) != NULL) in intr()
2688 letgo(private_t *pri) in letgo() argument
2691 pri->pname); in letgo()