OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [win/] [cat.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * cat.c --
3
 *
4
 *      Program used when testing tclWinPipe.c
5
 *
6
 * Copyright (c) 1996 by Sun Microsystems, Inc.
7
 *
8
 * See the file "license.terms" for information on usage and redistribution
9
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10
 *
11
 * RCS: @(#) $Id: cat.c,v 1.1.1.1 2002-01-16 10:25:38 markom Exp $
12
 */
13
 
14
#include <stdio.h>
15
#include <io.h>
16
#include <string.h>
17
 
18
int
19
main()
20
{
21
    char buf[1024];
22
    int n;
23
    char *err;
24
 
25
    while (1) {
26
        n = read(0, buf, sizeof(buf));
27
        if (n <= 0) {
28
            break;
29
        }
30
        write(1, buf, n);
31
    }
32
    err = (sizeof(int) == 2) ? "stderr16" : "stderr32";
33
    write(2, err, strlen(err));
34
 
35
    return 0;
36
}
37
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.