프로세스 아이디 구하기 썸네일형 리스트형 [C언어] 리눅스 프로세스 이름으로 프로세스 아이디(PID) 구하기 #include #include static int which_number (char *s){ int len, i; len = strlen (s); for (i = 0; i '9')) return -1; return atoi (s);}int get_pid_from_proc_by_name (char *str){ DIR *dp; struct dirent *dir; char buf[100], line[1024], tag[100], name[100]; int pid; FILE *fp; dp = opendir ("/proc"); if (!dp) return -1;.. 이전 1 다음