Lines Matching refs:p

85 int process_start(char* name, char* part, process_info_t* p, int is_helper) {  in process_start()  argument
135 p->terminated = 0; in process_start()
136 p->status = 0; in process_start()
163 p->pid = pid; in process_start()
164 p->name = strdup(name); in process_start()
165 p->stdout_file = stdout_file; in process_start()
207 process_info_t* p; in dowait() local
210 p = &args->vec[i]; in dowait()
211 if (p->terminated) continue; in dowait()
212 r = waitpid(p->pid, &p->status, 0); in dowait()
217 p->terminated = 1; in dowait()
240 process_info_t* p; in process_wait() local
336 p = &vec[i]; in process_wait()
337 kill(p->pid, SIGTERM); in process_wait()
353 long int process_output_size(process_info_t *p) { in process_output_size() argument
358 int r = fstat(fileno(p->stdout_file), &buf); in process_output_size()
368 int process_copy_output(process_info_t* p, FILE* stream) { in process_copy_output() argument
372 r = fseek(p->stdout_file, 0, SEEK_SET); in process_copy_output()
379 while ((r = fread(buf, 1, sizeof(buf), p->stdout_file)) != 0) in process_copy_output()
382 if (ferror(p->stdout_file)) { in process_copy_output()
392 int process_read_last_line(process_info_t *p, in process_read_last_line() argument
397 int r = fseek(p->stdout_file, 0, SEEK_SET); in process_read_last_line()
405 while (fgets(buffer, buffer_len, p->stdout_file) != NULL) { in process_read_last_line()
411 if (ferror(p->stdout_file)) { in process_read_last_line()
421 char* process_get_name(process_info_t *p) { in process_get_name() argument
422 return p->name; in process_get_name()
427 int process_terminate(process_info_t *p) { in process_terminate() argument
428 return kill(p->pid, SIGTERM); in process_terminate()
433 int process_reap(process_info_t *p) { in process_reap() argument
434 if (WIFEXITED(p->status)) { in process_reap()
435 return WEXITSTATUS(p->status); in process_reap()
437 return p->status; /* ? */ in process_reap()
443 void process_cleanup(process_info_t *p) { in process_cleanup() argument
444 fclose(p->stdout_file); in process_cleanup()
445 free(p->name); in process_cleanup()