TIMEOUT_FDOPEN(3)

NAME
timeout_fdopen - I/O streams with timeouts

LIBRARY
PDEL Library (libpdel, -lpdel)

SYNOPSIS
#include <sys/types.h>
#include <stdio.h>
#include <pdel/io/timeout_fp.h>
FILE *
timeout_fdopen(int fd, const char *mode, int timeout);

DESCRIPTION
timeout_fdopen() is equivalent to fdopen(3) with the addition of an enforced timeout on read or write operations on the underlying file descriptor fd.

If any read or write operation blocks for longer than timeout seconds, an error is returned with errno set to ETIMEDOUT.

If timeout is zero or negative, no timeout is imposed and the behavior is identical to fdopen(3).

fclose(3) should be used to close the returned stream.

RETURN VALUES
timeout_fdopen() returns NULL to indicate an error, with errno set appropriately.

SEE ALSO
fdopen(3), libpdel(3)

HISTORY
The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/

AUTHORS
Archie Cobbs <archie@packetdesign.com>