]> pd.if.org Git - pdclib/blob - platform/example/functions/_PDCLIB/isinteractive.c
ec3e7782837fa52f21b12783475e4d0111334e1b
[pdclib] / platform / example / functions / _PDCLIB / isinteractive.c
1 /* $Id$ */
2
3 /* _PDCLIB_isinteractive( _PDCLIB_fd_t fd )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 /* This is an example implementation of _PDCLIB_isinteractive() (declared in
10    _PDCLIB_glue.h), fit for use in POSIX kernels.
11    If you do not have an equivalent function, replace this with a return (1)
12    and you will have all streams line-buffered by default.
13 */
14
15 #ifndef REGTEST
16 #include <_PDCLIB_glue.h>
17
18 int isatty( int );
19
20 int _PDCLIB_isinteractive( int fd )
21 {
22     return isatty( fd );
23 }
24
25 #endif
26
27 #ifdef TEST
28 /* TODO: Work around the following undef */
29 #undef SEEK_SET
30 #include <_PDCLIB_test.h>
31
32 int main( void )
33 {
34     TESTCASE( NO_TESTDRIVER );
35     return TEST_RESULTS;
36 }
37
38 #endif