2 % (c) The GRASP/AQUA Project, Glasgow University, 1994
4 \subsection[getBufferMode.lc]{hIs...Buffered Runtime Support}
11 #ifdef HAVE_SYS_TYPES_H
12 #include <sys/types.h>
15 #ifdef HAVE_SYS_STAT_H
20 * We try to guess what the default buffer mode is going to be based
21 * on the type of file we're attached to.
35 /* Try to find out the file type */
36 while (fstat(fileno((FILE *) fp), &sb) < 0) {
44 /* Terminals are line-buffered by default */
45 if (S_ISCHR(sb.st_mode) && isatty(fileno((FILE *) fp)) == 1)
47 /* Default size block buffering for the others */