github.com/afumu/libc@v0.0.6/musl/src/stdio/__stdout_write.c (about)

     1  #include "stdio_impl.h"
     2  #include <sys/ioctl.h>
     3  
     4  size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
     5  {
     6  	struct winsize wsz;
     7  	f->write = __stdio_write;
     8  	if (!(f->flags & F_SVB) && __syscall(SYS_ioctl, f->fd, TIOCGWINSZ, &wsz))
     9  		f->lbf = -1;
    10  	return __stdio_write(f, buf, len);
    11  }