tools api: Add simple timeout to io read
authorIan Rogers <irogers@google.com>
Thu, 8 Jun 2023 06:18:11 +0000 (23:18 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 14 Jun 2023 21:19:06 +0000 (18:19 -0300)
commitf4c0d5309a3e5f16ca3c3854b1e719dace843e03
tree131f4cac5ffe7bf9e665477ba441d4de31572aca
parent99d4850062a84564f36923764bb93935ef2ed108
tools api: Add simple timeout to io read

In situations like reading from a pipe it can be useful to have a
timeout so that the caller doesn't block indefinitely. Implement a
simple one based on poll.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: http://lore.kernel.org/lkml/20230608061812.3715566-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/api/io.h