cctools
process.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2022 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 #include <errno.h>
15 
32 struct process_info {
33  pid_t pid;
34  int status;
35  struct rusage rusage;
36 };
37 
48 struct process_info *process_wait(int timeout);
49 
54 struct process_info *process_waitpid(pid_t pid, int timeout);
55 
61 int process_pending();
62 
68 int process_kill_waitpid(pid_t pid, int timeout);
69 
74 void process_putback(struct process_info *p);
75 
76 
77 
78 #endif
process_info::status
int status
The exit status of the process.
Definition: process.h:34
process_info::rusage
struct rusage rusage
The resource usage of the process.
Definition: process.h:35
process_kill_waitpid
int process_kill_waitpid(pid_t pid, int timeout)
Attempt to cleanly terminate process pid for timeout seconds by sending SIGTERM If the process has no...
process_putback
void process_putback(struct process_info *p)
Return a process_info structure to the queue.
process_info
Describes a completed process.
Definition: process.h:32
process_waitpid
struct process_info * process_waitpid(pid_t pid, int timeout)
Wait for a specific process to complete and return its status.
process_wait
struct process_info * process_wait(int timeout)
Wait for a process to complete, and return its status.
process_pending
int process_pending()
Detect if a child process has completed.
process_info::pid
pid_t pid
The process ID of a complete process.
Definition: process.h:33