? pidin.diff ? nto/x86/o/pidin.diff Index: pidin.c =================================================================== RCS file: /product/utils/p/pidin/pidin.c,v retrieving revision 1.71 diff -c -5 -p -w -r1.71 pidin.c *** pidin.c 13 Feb 2004 18:17:02 -0000 1.71 --- pidin.c 26 Jan 2007 20:47:09 -0000 *************** *** 27,39 **** #include #include #include #include #include ! ! char *opts = "d:klM:n:f:F:ho:p:P:"; void dspinfo(pid_t pid, char *pidname, int flags, const char *fmt, const char *mem_format); void piddspinfo(int fd, char *pidname, pid_t pid, int flags, const char *fmt, const char *mem_format); int find_netdir(char *nodename, char *buf, size_t bufsize, int flag); --- 27,39 ---- #include #include #include #include #include + #include ! char *opts = "d:klM:n:f:F:ho:p:P:r:R:"; void dspinfo(pid_t pid, char *pidname, int flags, const char *fmt, const char *mem_format); void piddspinfo(int fd, char *pidname, pid_t pid, int flags, const char *fmt, const char *mem_format); int find_netdir(char *nodename, char *buf, size_t bufsize, int flag); *************** main(int argc, char *argv[]) *** 188,203 **** case 'o': pri = strtoul(optarg, 0, 0); break; case 'p': ! flags = DONT_RECURSE; /* * fall through */ case 'P': if(*optarg >= '0' && *optarg <= '9') { p = atoi(optarg); } else { pidname = optarg; } --- 188,208 ---- case 'o': pri = strtoul(optarg, 0, 0); break; + case 'r': case 'p': ! flags |= DONT_RECURSE; /* * fall through */ + + case 'R': case 'P': + if ( c=='r' || c=='R') flags |= DO_REGEXEC; + if(*optarg >= '0' && *optarg <= '9') { p = atoi(optarg); } else { pidname = optarg; } *************** piddspinfo(int fd, char *pidname, pid_t *** 848,857 **** --- 853,863 ---- { int tid, lasttid; const char *f; struct shared_info info; int special = 0; + regex_t re; info.name = 0; info.mem = 0; info.info = 0; info.irqs = 0; *************** piddspinfo(int fd, char *pidname, pid_t *** 874,885 **** return; } if(!(f = strrchr(info.name->path, '/'))) { f = info.name->path; } while(*f && *f == '/') { f++; } ! if(strcmp(f, pidname) != 0) { return; } } if (mf) { --- 880,901 ---- return; } if(!(f = strrchr(info.name->path, '/'))) { f = info.name->path; } + while(*f && *f == '/') { f++; } ! if (flags & DO_REGEXEC) { ! if (regcomp( &re, pidname, REG_NOSUB) != 0) { ! return; ! } ! if(regexec(&re, f, 0, NULL, 0)!=0) { ! regfree(&re); ! return; ! } ! regfree(&re); ! } else if(strcmp(f, pidname) != 0) { return; } } if (mf) { Index: pidin.h =================================================================== RCS file: /product/utils/p/pidin/pidin.h,v retrieving revision 1.33 diff -c -5 -p -w -r1.33 pidin.h *** pidin.h 13 Feb 2004 18:17:02 -0000 1.33 --- pidin.h 26 Jan 2007 20:47:09 -0000 *************** *** 24,33 **** --- 24,34 ---- /* * flags for dspinfo */ #define DONT_RECURSE 0x1 #define DO_THREADS 0x2 + #define DO_REGEXEC 0x4 struct shared_info; extern struct format { int width; Index: pidin.use =================================================================== RCS file: /product/utils/p/pidin/pidin.use,v retrieving revision 1.12 diff -c -5 -p -w -r1.12 pidin.use *** pidin.use 26 Jan 2004 19:17:56 -0000 1.12 --- pidin.use 26 Jan 2007 20:47:09 -0000 *************** pidin [options] argument - display syste *** 8,17 **** --- 8,19 ---- -M formats format string (as in printf()) -n node remote QNX node you are interested in -o prio run at prio priority -P pid process family (pid or name) you are interested in -p pid process (pid or name) you are interested in + -r -p pid process (pid or name or subname) you are interested in + Formats A - arguments a - pid B - what you are blocked on b - tid