SSL_GET_ALL_ASYNC_FDS(3ossl)
π SSL_GET_ALL_ASYNC_FDS(3ossl) β like, the async-fd management page, bestie
okay so this is the 3ossl manual page for SSL_waiting_for_async, SSL_get_all_async_fds and SSL_get_changed_async_fds, and honestly? it's giving "async operations but make it a to-do list" energy. stay with me, it's not scary π«Ά
β¨ NAME β¨
SSL_waiting_for_async, SSL_get_all_async_fds, SSL_get_changed_async_fds β manage asynchronous operations π«
πΈ SYNOPSIS πΈ
#include <openssl/async.h>
#include <openssl/ssl.h>
int SSL_waiting_for_async(SSL *s);
int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fd, size_t *numfds);
int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, size_t *numaddfds,
OSSL_ASYNC_FD *delfd, size_t *numdelfds);
copy these exactly, no cap. the compiler is not your friend if you freestyle the signatures π
π¦ DESCRIPTION π¦
the vibe check: SSL_waiting_for_async()
SSL_waiting_for_async() determines whether an SSL connection is currently waiting for asynchronous operations to complete β and like, that's the SSL_MODE_ASYNC mode in SSL_CTX_set_mode(3), iykyk. basically: is your connection in its waiting era or not π
SSL_get_all_async_fds() β the fd list drop π
SSL_get_all_async_fds() returns a list of file descriptor which can be used in a call to select() or poll() to determine whether the current asynchronous operation has completed or not. so you hand these fds to select()/poll() and let them do the watching, periodt.
a completed operation will result in data appearing as "read ready" on the file descriptor β and no actual data should be read from the file descriptor β οΈ like, it's signalling, not snacking. do not read it. hands off.
this function should only be called if the SSL object is currently waiting for asynchronous work to complete β i.e. SSL_ERROR_WANT_ASYNC has been received, see SSL_get_error(3). typically the list will only contain one file descriptor. however, if multiple asynchronous capable engines are in use then more than one is possible.
the number of file descriptors returned is stored in *numfds and the file descriptors themselves are in *fds. the fds parameter may be NULL, in which case no file descriptors are returned, but *numfds is still populated. and here's the part everyone forgets: it is the caller's responsibility to ensure sufficient memory is allocated at *fds, so typically this function is called twice β once with a NULL fds parameter and once without. classic "first ask how many, then ask for the goods" two-step π
SSL_get_changed_async_fds() β the delta report π
SSL_get_changed_async_fds() returns a list of the asynchronous file descriptors that have been added and a list that have been deleted since the last SSL_ERROR_WANT_ASYNC was received (or since the SSL object was created, if no SSL_ERROR_WANT_ASYNC has been received). it's the what's-new / what's-gone update π
similar to SSL_get_all_async_fds(), it is the caller's responsibility to ensure that *addfd and *delfd have sufficient memory allocated β although they may be NULL. the number of added fds and the number of deleted fds are stored in *numaddfds and *numdelfds respectively. two lists, two counters, one very organised bestie π§
β RETURN VALUES β
SSL_waiting_for_async()β returns1if the current SSL operation is waiting for an async operation to complete, and0otherwise. simple. iconic.SSL_get_all_async_fds()andSSL_get_changed_async_fds()β return1on success or0on error. always check, bestie, fr fr π
π NOTES π
on Windows platforms the <openssl/async.h> header is dependent on some of the types customarily made available by including <windows.h>. the application developer is likely to require control over when the latter is included β commonly as one of the first included headers.
therefore, it is defined as an application developer's responsibility to include <windows.h> prior to <openssl/async.h> π
β οΈ order matters here, like genuinely.<windows.h>first, then<openssl/async.h>. don't come crying to me when it doesn't compile π
π SEE ALSO π
ssl(7), SSL_get_error(3), SSL_CTX_set_mode(3) β go read those next, they're literally the lore π«Ά
π₯ HISTORY π₯
the SSL_waiting_for_async(), SSL_get_all_async_fds() and SSL_get_changed_async_fds() functions were added in OpenSSL 1.1.0. so they've been serving since day one, periodt β¨
π COPYRIGHT π
Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie π this rewrite is living in version 3.5.0, dated 2026-09-25, and yeah β it's still the SSL_GET_ALL_ASYNC_FDS(3ossl) of our hearts. go forth and select() responsibly π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms