summaryrefslogtreecommitdiff
path: root/src/stdio/__stdio_write.c
blob: 785456265ac6f33910fa343dfff55d355b1e809d (plain) (blame)
1
2
3
4
5
6
7
8
9
#include "stdio_impl.h"

size_t __stdio_write(FILE *f, const unsigned char *buf, size_t len)
{
	const unsigned char *stop = buf+len;
	ssize_t cnt = 1;
	for (; buf<stop && (cnt=__syscall_write(f->fd, buf, len))>0; buf+=cnt);
	return len-(stop-buf);
}