Back to libut API Reference


SYNOPSIS

    #include "libut/ut.h"
    int UT_iob_writefd(UT_iob *iob, int fd);


DESCRIPTION

This function writes the given iob to the file descriptor fd. This is more efficient than calling UT_iob_flatten(3) and writing, because it avoids copying.


RETURN VALUE

This function returns the number of bytes written, or -1 if an error occurs. In the case of an error a log message is also generated.


NOTES

The write may finish in the background after this function returns, if the underlying file descriptor is a socket in non-blocking mode. Sockets created using UT_net_connect(3) and UT_net_listen(3) are non-blocking.


SEE ALSO

UT_iob_create(3), UT_iob_printf(3), UT_iob_append(3), UT_iob_free(3), UT_iob_bufcmp(3), UT_iob_flatten(3), UT_iob_len(3)


AUTHOR

Troy D. Hanson <thanson@users.sourceforge.net>