From 9ee0a776cab9a54e3a55525be79bb7c50b215841 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 26 Apr 2012 19:42:22 +0000 Subject: split the functionality to read everything from the stream into a separate function and don't assume we use non-blocking IO (fix r1637) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1659 ef36b2f9-881f-0410-afb5-c4e39611909c --- common/tio.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common/tio.h') diff --git a/common/tio.h b/common/tio.h index 832367b..59f26df 100644 --- a/common/tio.h +++ b/common/tio.h @@ -56,11 +56,12 @@ TFILE *tio_fdopen(int fd,struct timeval *readtimeout,struct timeval *writetimeou /* Read the specified number of bytes from the stream. */ int tio_read(TFILE *fp,void *buf,size_t count); -/* Read and discard the specified number of bytes from the stream. - If count is 0 reads and discards any data that can be read and empties - the read buffer. */ +/* Read and discard the specified number of bytes from the stream. */ int tio_skip(TFILE *fp,size_t count); +/* Read all available data from the stream and empty the read buffer. */ +int tio_skipall(TFILE *fp); + /* Write the specified buffer to the stream. */ int tio_write(TFILE *fp,const void *buf,size_t count); -- cgit v1.2.3