os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/win/cat.c
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/win/cat.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,37 @@
1.4 +/*
1.5 + * cat.c --
1.6 + *
1.7 + * Program used when testing tclWinPipe.c
1.8 + *
1.9 + * Copyright (c) 1996 by Sun Microsystems, Inc.
1.10 + *
1.11 + * See the file "license.terms" for information on usage and redistribution
1.12 + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1.13 + *
1.14 + * RCS: @(#) $Id: cat.c,v 1.2 1998/09/14 18:40:19 stanton Exp $
1.15 + */
1.16 +
1.17 +#include <stdio.h>
1.18 +#include <io.h>
1.19 +#include <string.h>
1.20 +
1.21 +int
1.22 +main()
1.23 +{
1.24 + char buf[1024];
1.25 + int n;
1.26 + char *err;
1.27 +
1.28 + while (1) {
1.29 + n = read(0, buf, sizeof(buf));
1.30 + if (n <= 0) {
1.31 + break;
1.32 + }
1.33 + write(1, buf, n);
1.34 + }
1.35 + err = (sizeof(int) == 2) ? "stderr16" : "stderr32";
1.36 + write(2, err, strlen(err));
1.37 +
1.38 + return 0;
1.39 +}
1.40 +