1 #include <newlib.h> 2 3 #ifdef _FVWRITE_IN_STREAMIO 4 5 #include <stdio.h> 6 #include "fvwrite.h" 7 8 extern int __ssputs (FILE *fp, const char *buf, 9 size_t len); 10 11 int __ssprint(FILE * fp,register struct __suio * uio)12__ssprint ( 13 FILE *fp, 14 register struct __suio *uio) 15 { 16 register struct __siov *iov = uio->uio_iov; 17 register size_t len; 18 int ret = 0; 19 20 while (uio->uio_resid > 0 && uio->uio_iovcnt-- > 0) { 21 if ((len = iov->iov_len) > 0) { 22 if (__ssputs (fp, iov->iov_base, len) == EOF) { 23 ret = EOF; 24 break; 25 } 26 uio->uio_resid -= len; /* pretend we copied all */ 27 } 28 iov++; 29 } 30 uio->uio_resid = 0; 31 uio->uio_iovcnt = 0; 32 return ret; 33 } 34 35 #endif 36