Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: July 2017
 
 

dax_poll (3DAX)

Name

dax_poll - poll for command completion

Synopsis

cc [ flag... ] file... -ldax [ library...]

#include <dax.h>

int dax_poll(dax_queue_t *queue, dax_poll_t res[], int nres,
    int64_t timeout);

Description

This function polls for the completion of up to nres requests posted to the queue. Returns the status of the completed requests in the res array.

The behavior of this function for various values of the timeout parameter is as follows:

  • If timeout < 0, waits indefinitely for the nres requests to complete.

  • If timeout == 0, returns immediately with the results of at most nres completed requests.

  • If timeout > 0, waits for timeout nanoseconds to elapse, or for nres requests to complete, whichever is first.

The members of the dax_poll_t structure are:

udata

The udata value for the operation that completed, as passed to the corresponding post function.

status

The completion status. Possible values are the return values in the dax_result_t status field for the corresponding non-poll function, plus:

DAX_EPIPE

The current request piped its output to another request, and the other request completed with status != DAX_SUCCESS or another request piped its output to the current request, and the other request completed with status != DAX_SUCCESS.

count

Result count. Possible values are the return values in the dax_result_t count field for the corresponding non-poll function.

Return Values

0

No requests completed

A positive value

The number of requests completed

DAX_EQEMPTY

No requests are pending

DAX_EINVAL

nres is 0 or negative

DAX_ETHREAD

The calling thread did not create the queue

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed

See Also

libdax(3LIB), dax_queue_create(3DAX), dax_post(3DAX)

Notes

This function moves the requests that are yet to start from the software dax_queue_t queue to the DAX hardware queue as and when space is available in the DAX hardware. Therefore, to guarantee forward progress, periodic calls to the dax_poll() function are necessary.