File: proc_child.c

package info (click to toggle)
apr 1.7.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,448 kB
  • sloc: ansic: 66,059; sh: 4,279; perl: 900; awk: 393; makefile: 375; python: 146
file content (21 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "apr.h"
#include <stdio.h>
#if APR_HAVE_UNISTD_H
#include <unistd.h>
#endif
#if APR_HAVE_IO_H
#include <io.h>
#endif
#include <stdlib.h>

int main(void)
{
    char buf[256];
    int bytes, rv = 0;
    
    bytes = (int)read(STDIN_FILENO, buf, 256);
    if (bytes > 0)
        rv = write(STDOUT_FILENO, buf, (unsigned int)bytes) == bytes ? 0 : 1;

    return rv;
}