process.h
Go to the documentation of this file.
/*
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef PROCESS_H
#define PROCESS_H
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <errno.h>
struct process_info {
pid_t pid;
int status;
struct rusage rusage;
};
struct process_info *process_wait(int timeout);
struct process_info *process_waitpid(pid_t pid, int timeout);
int process_pending();
int process_kill_waitpid(pid_t pid, int timeout);
void process_putback(struct process_info *p);
#endif
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_putback
void process_putback(struct process_info *p)
Return a process_info structure to the queue.
process_waitpid
struct process_info * process_waitpid(pid_t pid, int timeout)
Wait for a specific process to complete and return its status.
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_info
Describes a completed process.
Definition process.h:32
process_info::pid
pid_t pid
The process ID of a complete process.
Definition process.h:33
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