File:  [CSRG BSD Unix] / 43BSDReno / contrib / mh / sbr / cpydata.c
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

/* cpydata.c - copy from one fd to another */

#include "../h/mh.h"
#include <stdio.h>


void cpydata (in, out, ifile, ofile)
register int    in,
                out;
register char  *ifile,
               *ofile;
{
    register int    i;
    char    buffer[BUFSIZ];

    while ((i = read (in, buffer, sizeof buffer)) > 0)
	if (write (out, buffer, i) != i)
	    adios (ofile, "error writing");

    if (i == NOTOK)
	adios (ifile, "error reading");
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.