MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xo_is_line_buffered

Function xo_is_line_buffered

tools/libxo/libxo/libxo.c:590–601  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

588 * something we're willing to do.
589 */
590static int
591xo_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

Callers 1

xo_init_handleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected