summaryrefslogtreecommitdiff
path: root/src/stdio/__stdio_write.c
blob: d4264eff29b10a27adc1709e67dc3bd4bf763a79 (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(SYS_write, f->fd, buf, len))>0; buf+=cnt);
	return len-(stop-buf);
}