Back to index

radiance  4R0+20100331
Functions | Variables
process.c File Reference
#include "copyright.h"
#include "rtprocess.h"

Go to the source code of this file.

Functions

int process (SUBPROC *pd, char *recvbuf, char *sendbuf, int nbr, int nbs)
int readbuf (int fd, char *bpos, int siz)
int writebuf (int fd, char *bpos, int siz)

Variables

static const char RCSid [] = "$Id: process.c,v 2.8 2004/09/17 21:43:49 greg Exp $"

Function Documentation

int process ( SUBPROC pd,
char *  recvbuf,
char *  sendbuf,
int  nbr,
int  nbs 
)

Definition at line 25 of file process.c.

{
       if (nbs > PIPE_BUF)
              return(-1);
       if (!pd->running)
              return(-1);
       if (writebuf(pd->w, sendbuf, nbs) < nbs)
              return(-1);
       return(readbuf(pd->r, recvbuf, nbr));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int readbuf ( int  fd,
char *  bpos,
int  siz 
)

Definition at line 43 of file process.c.

{
       register int  cc = 0, nrem = siz;
retry:
       while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) {
              bpos += cc;
              nrem -= cc;
       }
       if (cc < 0) {
#ifndef BSD
              if (errno == EINTR)  /* we were interrupted! */
                     goto retry;
#endif
              return(cc);
       }
       return(siz-nrem);
}

Here is the caller graph for this function:

int writebuf ( int  fd,
char *  bpos,
int  siz 
)

Definition at line 67 of file process.c.

{
       register int  cc = 0, nrem = siz;
retry:
       while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) {
              bpos += cc;
              nrem -= cc;
       }
       if (cc < 0) {
#ifndef BSD
              if (errno == EINTR)  /* we were interrupted! */
                     goto retry;
#endif
              return(cc);
       }
       return(siz-nrem);
}

Here is the caller graph for this function:


Variable Documentation

const char RCSid[] = "$Id: process.c,v 2.8 2004/09/17 21:43:49 greg Exp $" [static]

Definition at line 2 of file process.c.