0posinfinity codedataieeec problem 228 solution pg

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t fd, const void *vptr, size_t n); ssize_t readline(int fd, void *vptr, size_t maxlen); /* non-reentrant */ /* * Stevens’s reentrant readline_r package */ /* struct used by readline_r */ typedef struct { int read_fd; /* caller’s descriptor to read from */ char *read_ptr; /* caller’s buffer to read into */ size_t read_maxlen; /* max bytes to read */ /* next three are used int rl_cnt; /* char *rl_bufptr; /* char rl_buf[MAXBUF];/* } Rline; internally by the function */ initialize to 0 */ initialize to rl_buf */ internal buffer */ void readline_rinit(int fd, void *ptr, size_t maxlen, Rline *rptr); ssize_t readline_r(Rline *rptr); 674 147 148 149 150 151 152 153 154 155 156 APPENDIX A. ERROR HANDLING /* Wrappers for Stevens’s socket I/O helpers */ ssize_t Readn(int fd, void *vptr, size_t n); void Writen(int fd, void *vptr, size_t n); ssize_t Readline(int fd, void *vptr, size_t maxlen); ssize_t Readline_r(Rline *); void Readline_rinit(int fd, void *ptr, size_t maxlen, Rline *rptr); /* Our own client/ser...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online