[#ASYNC_WAIT_CTX_set_wait_fd]
= ASYNC&lowbar;WAIT&lowbar;CTX&lowbar;set&lowbar;wait&lowbar;fd
:mrdocs:

Associate a waitable file descriptor with a key in the wait context&period;

== Synopsis

Declared in `&lt;openssl&sol;async&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
ASYNC&lowbar;WAIT&lowbar;CTX&lowbar;set&lowbar;wait&lowbar;fd(
    xref:ASYNC_WAIT_CTX.adoc[ASYNC&lowbar;WAIT&lowbar;CTX]* ctx,
    void const* key,
    int fd,
    void* custom&lowbar;data,
    void(* cleanup)(xref:ASYNC_WAIT_CTX.adoc[ASYNC&lowbar;WAIT&lowbar;CTX]*, void const*, int, void*));
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Wait context to update&period;
| *key*
| Unique key identifying this wait fd&period;
| *fd*
| File descriptor to wait on&period;
| *custom&lowbar;data*
| Optional application data for the cleanup callback&period;
| *cleanup*
| Optional callback to release `custom&lowbar;data` when the fd is cleared&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
