* We need to decide if stdout is line buffered (_IOLBF). Lacking a * standard way to decide this (e.g. getlinebuf()), we have configure * look to find __flbf, which glibc supported. If not, we'll rely on * isatty, with the assumption that terminals are the only thing * that's line buffered. We _could_ test for "steam._flags & _IOLBF", * which is all __flbf does, but that's even tackier. L
| 588 | * something we're willing to do. |
| 589 | */ |
| 590 | static int |
| 591 | xo_is_line_buffered (FILE *stream) |
| 592 | { |
| 593 | #if HAVE___FLBF |
| 594 | if (__flbf(stream)) |
| 595 | return 1; |
| 596 | #else /* HAVE___FLBF */ |
| 597 | if (isatty(fileno(stream))) |
| 598 | return 1; |
| 599 | #endif /* HAVE___FLBF */ |
| 600 | return 0; |
| 601 | } |
| 602 | |
| 603 | /* |
| 604 | * Initialize an xo_handle_t, using both static defaults and |