Flushing libgfortran from C

Yuri Gribov tetra2005@googlemail.com
Fri Mar 4 04:35:00 GMT 2011


Aha and here is the code which decides what type stdout is:

static stream *
fd_to_stream (int fd, int prot)
{
  ...

s->special_file = !S_ISREG (statbuf.st_mode);

if (isatty (s->fd) || options.all_unbuffered
    ||(options.unbuffered_preconnected &&
       (s->fd == STDIN_FILENO
        || s->fd == STDOUT_FILENO
        || s->fd == STDERR_FILENO)))
  raw_init (s);
else
  buf_init (s);

Now if my stdout is redirected to file isatty is 0 and if no buffering
environment variables are defined (so options.* are false) we'll have
the buf_init which uses the code path which I described above.

--
Best regards,
Yuri



More information about the Fortran mailing list