mirror of
https://github.com/torvalds/linux.git
synced 2026-12-06 13:23:45 +00:00
int read_with_timeout(int fd, char *buf, size_t count, long usec) As a regular read(2), but allows to specify a timeout in micro-seconds. Returns -EAGAIN on timeout. Implemented using select(). Signed-off-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
8 lines
234 B
C
8 lines
234 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <unistd.h>
|
|
|
|
/* As a regular read(2), but allows to specify a timeout in micro-seconds.
|
|
* Returns -EAGAIN on timeout.
|
|
*/
|
|
int read_with_timeout(int fd, char *buf, size_t count, long usec);
|