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