From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/stdio/__stdout_write.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/stdio/__stdout_write.c (limited to 'src/stdio/__stdout_write.c') diff --git a/src/stdio/__stdout_write.c b/src/stdio/__stdout_write.c new file mode 100644 index 0000000..dd1ec60 --- /dev/null +++ b/src/stdio/__stdout_write.c @@ -0,0 +1,11 @@ +#include "stdio_impl.h" +#include + +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); +} -- cgit v1.2.3