cctools
process.h
Go to the documentation of this file.
1/*
2Copyright (C) 2022 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See 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
33 pid_t pid;
34 int status;
35 struct rusage rusage;
36};
37
48struct process_info *process_wait(int timeout);
49
54struct process_info *process_waitpid(pid_t pid, int timeout);
55
62
68int process_kill_waitpid(pid_t pid, int timeout);
69
75
76
77
78#endif
struct process_info * process_wait(int timeout)
Wait for a process to complete, and return its status.
int process_pending()
Detect if a child process has completed.
void process_putback(struct process_info *p)
Return a process_info structure to the queue.
struct process_info * process_waitpid(pid_t pid, int timeout)
Wait for a specific process to complete and return its status.
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...
Describes a completed process.
Definition process.h:32
pid_t pid
The process ID of a complete process.
Definition process.h:33
int status
The exit status of the process.
Definition process.h:34
struct rusage rusage
The resource usage of the process.
Definition process.h:35