cctools
process.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2008- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef PROCESS_H
8 #define PROCESS_H
9 
10 #include <sys/time.h>
11 #include <sys/types.h>
12 #include <sys/resource.h>
13 #include <sys/wait.h>
14 
31 struct process_info {
32  pid_t pid;
33  int status;
34  struct rusage rusage;
35 };
36 
47 struct process_info *process_wait(int timeout);
48 
53 struct process_info *process_waitpid(pid_t pid, int timeout);
54 
60 int process_pending();
61 
66 void process_putback(struct process_info *p);
67 
68 
69 
70 #endif
struct rusage rusage
The resource usage of the process.
Definition: process.h:34
void process_putback(struct process_info *p)
Return a process_info structure to the queue.
int status
The exit status of the process.
Definition: process.h:33
Describes a completed process.
Definition: process.h:31
int process_pending()
Detect if a child process has completed.
pid_t pid
The process ID of a complete process.
Definition: process.h:32
struct process_info * process_waitpid(pid_t pid, int timeout)
Wait for a specific process to complete and return its status.
struct process_info * process_wait(int timeout)
Wait for a process to complete, and return its status.