1 /* $Id: term.c,v 1.6 2020-10-16 20:56:21 phil Exp $ */
2 
3 #ifdef HAVE_CONFIG_H
4 #include "config.h"
5 #endif /* HAVE_CONFIG_H defined */
6 
7 #include <stdio.h>
8 
9 #ifdef HAVE_UNISTD_H
10 #include <unistd.h>
11 #else  /* HAVE_UNISTD_H not defined */
12 #define STDERR_FILENO 2
13 #endif /* HAVE_UNISTD_H not defined */
14 
15 #include "h.h"
16 #include "snotypes.h"
17 #include "lib.h"
18 
19 /*
20  * return a stdio stream for TERMINAL input variable
21  * POSIX.1 version; fdopen() on stderr stream
22  */
23 
24 FILE *
term_input(void)25 term_input(void) {
26     return fdopen(dup(STDERR_FILENO), "r");
27 }
28