![]() |
Defines | |
#define | MAX_IOSEND_SIZE (32 * 1024) |
Functions | |
int | qIoWaitReadable (int fd, int timeoutms) |
Test & wait until the file descriptor has readable data. | |
int | qIoWaitWritable (int fd, int timeoutms) |
Test & wait until the file descriptor is ready for writing. | |
ssize_t | qIoRead (void *buf, int fd, size_t nbytes, int timeoutms) |
Read from a file descriptor. | |
ssize_t | qIoWrite (int fd, const void *buf, size_t nbytes, int timeoutms) |
Write to a file descriptor. | |
off_t | qIoSend (int outfd, int infd, off_t nbytes, int timeoutms) |
Transfer data between file descriptors. | |
ssize_t | qIoGets (char *buf, size_t bufsize, int fd, int timeoutms) |
Read a line from a file descriptor into the buffer pointed to until either a terminating newline or EOF. | |
ssize_t | qIoPuts (int fd, const char *str, int timeoutms) |
Writes the string and a trailing newline to file descriptor. | |
ssize_t | qIoPrintf (int fd, int timeoutms, const char *format,...) |
Formatted output to a file descriptor. |
int qIoWaitReadable | ( | int | fd, | |
int | timeoutms | |||
) |
Test & wait until the file descriptor has readable data.
fd | file descriptor | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
int qIoWaitWritable | ( | int | fd, | |
int | timeoutms | |||
) |
Test & wait until the file descriptor is ready for writing.
fd | file descriptor | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
ssize_t qIoRead | ( | void * | buf, | |
int | fd, | |||
size_t | nbytes, | |||
int | timeoutms | |||
) |
Read from a file descriptor.
buf | data buffer pointer to write to | |
fd | file descriptor | |
nbytes | the number of bytes to read from file descriptor & write into buffer | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
ssize_t qIoWrite | ( | int | fd, | |
const void * | buf, | |||
size_t | nbytes, | |||
int | timeoutms | |||
) |
Write to a file descriptor.
fd | file descriptor | |
buf | data buffer pointer to read from | |
nbytes | the number of bytes to write to file descriptor & read from buffer | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
off_t qIoSend | ( | int | outfd, | |
int | infd, | |||
off_t | nbytes, | |||
int | timeoutms | |||
) |
Transfer data between file descriptors.
outfd | output file descriptor | |
infd | input file descriptor | |
nbytes | the number of bytes to copy between file descriptors. 0 means transfer until end of infd. | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
ssize_t qIoGets | ( | char * | buf, | |
size_t | bufsize, | |||
int | fd, | |||
int | timeoutms | |||
) |
Read a line from a file descriptor into the buffer pointed to until either a terminating newline or EOF.
New-line characters(CR, LF ) will not be stored into buffer.
buf | data buffer pointer | |
bufsize | buffer size | |
fd | file descriptor | |
timeoutms | wait timeout milliseconds |
ssize_t qIoPuts | ( | int | fd, | |
const char * | str, | |||
int | timeoutms | |||
) |
Writes the string and a trailing newline to file descriptor.
fd | file descriptor | |
str | string pointer | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait |
ssize_t qIoPrintf | ( | int | fd, | |
int | timeoutms, | |||
const char * | format, | |||
... | ||||
) |
Formatted output to a file descriptor.
fd | file descriptor | |
timeoutms | wait timeout milliseconds. 0 for no wait, -1 for infinite wait | |
format | format string |