반응형
int puts(const char *s)
#include <stdio.h> #include <string.h> #include "fvwrite.h" /* * Write the given string to stdout, appending a newline. */ int puts(const char *s) { size_t c = strlen(s); struct __suio uio; struct __siov iov[2]; iov[0].iov_base = (void *)s; iov[0].iov_len = c; iov[1].iov_base = "\n"; iov[1].iov_len = 1; uio.uio_resid = c + 1; uio.uio_iov = &iov[0]; uio.uio_iovcnt = 2; return (__sfvwrite(stdout, &uio) ? EOF : '\n'); }
반응형