Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PipeStream.cc File Reference

#include <config.h>
#include <PipeStream.h>
#include <Util.h>
#include <iostream>
#include <cstdio>
#include <cctype>
#include <cerrno>
#include <cassert>
#include <unistd.h>
#include <sys/signal.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <map>
#include <stringstream.h>

Namespaces

namespace  PipeStreamSignalHandling

Classes

struct  PipeStreamSignalHandling::process_status

Functions

bool got_status (pid_t pid, int *status)
 Checks to see if the given process has exited.
void expectAnother () throw (InputByteStreamError)
 Note that we expect to start another child.
void childcatcher (int)
void alarmcatcher (int)

Variables

process_status * procs = 0
sig_atomic_t nprocs
sig_atomic_t nprocs_used

Function Documentation

void PipeStreamSignalHandling::alarmcatcher int   ) 
 

void PipeStreamSignalHandling::childcatcher int   ) 
 

void PipeStreamSignalHandling::expectAnother  )  throw (InputByteStreamError)
 

Note that we expect to start another child.

This function must be called before doing each fork(), as it does the initialisation of the structures used by this set of functions, and subsequently ensures that there is enough space in the list of statuses to hold another one.

Exceptions:
InputByteStreamError if we can't do this for some reason

bool PipeStreamSignalHandling::got_status pid_t  pid,
int *  status
 

Checks to see if the given process has exited.

If there's an entry for this PID in the list, then put the corresponding status in the status parameter, and return true. If not, return false; *status is then unchanged.

Parameters:
pid the PID to check
status a pointer to the status to be returned
Returns:
true if the status was in fact available, and is now in *status; false otherwise


Variable Documentation

sig_atomic_t PipeStreamSignalHandling::nprocs
 

sig_atomic_t PipeStreamSignalHandling::nprocs_used
 

struct process_status* PipeStreamSignalHandling::procs = 0
 


Generated on Sun Aug 21 18:21:03 2005 for dvi2bitmap by doxygen 1.3.8