summaryrefslogtreecommitdiff
path: root/src/stdio/__stdout_write.c
blob: 5b413c79777d1aa7f436b864ec02e5086d6ce37f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "stdio_impl.h"
#include <sys/ioctl.h>
#include <termios.h>

size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
{
	struct winsize wsz;
	f->write = __stdio_write;
	if (!(f->flags & F_SVB) && __syscall(SYS_ioctl, f->fd, TIOCGWINSZ, &wsz))
		f->lbf = -1;
	return __stdio_write(f, buf, len);
}