1 /* Copyright (C) 2001 artofcode LLC. All rights reserved.
2
3 This software is provided AS-IS with no warranty, either express or
4 implied.
5
6 This software is distributed under license and may not be copied,
7 modified or distributed except as expressly authorized under the terms
8 of the license contained in the file LICENSE in this distribution.
9
10 For more information about licensing, please refer to
11 http://www.ghostscript.com/licensing/. For information on
12 commercial licensing, go to http://www.artifex.com/licensing/ or
13 contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14 San Rafael, CA 94903, U.S.A., +1(415)492-9861.
15 */
16
17 /* $Id: gp_stdia.c,v 1.5 2002/02/21 22:24:52 giles Exp $ */
18 /* Read stdin on platforms that support unbuffered read. */
19 /* We want unbuffered for console input and pipes. */
20
21 #include "stdio_.h"
22 #include "time_.h"
23 #include "unistd_.h"
24 #include "gx.h"
25 #include "gp.h"
26
27
28 /* Read bytes from stdin, unbuffered if possible. */
gp_stdin_read(char * buf,int len,int interactive,FILE * f)29 int gp_stdin_read(char *buf, int len, int interactive, FILE *f)
30 {
31 return read(fileno(f), buf, len);
32 }
33
34