Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdio / ssprint_r.c
blobeedbd6a9390ed4cae246371a94915a2192ad39c0
1 #include <newlib.h>
3 #ifdef _FVWRITE_IN_STREAMIO
5 #include <reent.h>
6 #include <stdio.h>
7 #include "fvwrite.h"
9 extern int __ssputs_r (struct _reent *ptr, FILE *fp, const char *buf,
10 size_t len);
12 int
13 __ssprint_r (struct _reent *ptr,
14 FILE *fp,
15 register struct __suio *uio)
17 register struct __siov *iov = uio->uio_iov;
18 register size_t len;
19 int ret = 0;
21 while (uio->uio_resid > 0 && uio->uio_iovcnt-- > 0) {
22 if ((len = iov->iov_len) > 0) {
23 if (__ssputs_r (ptr, fp, iov->iov_base, len) == EOF) {
24 ret = EOF;
25 break;
27 uio->uio_resid -= len; /* pretend we copied all */
29 iov++;
31 uio->uio_resid = 0;
32 uio->uio_iovcnt = 0;
33 return ret;
36 #endif