---
name: "eventfd_ctx_read"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/eventfd_ctx_read"
---

# eventfd\_ctx\_read(9)

Reads the eventfd counter or wait if it is zero.

## NAME

eventfd\_ctx\_read - Reads the eventfd counter or wait if it is zero.

## SYNOPSIS

**ssize\_t eventfd\_ctx\_read(struct eventfd\_ctx \*** *ctx***, int** *no\_wait***, \_\_u64 \*** *cnt***);**

## ARGUMENTS

*ctx*

\[in\] Pointer to eventfd context.

*no\_wait*

\[in\] Different from zero if the operation should not block.

*cnt*

\[out\] Pointer to the 64-bit counter value.

## DESCRIPTION

Returns **0** if successful, or the following error codes:

\-EAGAIN : The operation would have blocked but *no\_wait* was non-zero. -ERESTARTSYS : A signal interrupted the wait operation.

If *no\_wait* is zero, the function might sleep until the eventfd internal counter becomes greater than zero.

## COPYRIGHT
