diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:26 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:26 +0100 |
commit | 987942a206ef0f2342bf81d5de6432c6af42b7e7 (patch) | |
tree | 6befd1ab8680f2936d94ac84c94cf4f68f16c14e /doc/socket_functions.rst | |
parent | 163bc6d7fc268bdb1c7cc03699f69d0c5cc0b4cd (diff) |
New upstream version 4.17upstream/4.17
Diffstat (limited to 'doc/socket_functions.rst')
-rw-r--r-- | doc/socket_functions.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/socket_functions.rst b/doc/socket_functions.rst index 5d55cf8..fef6e7c 100644 --- a/doc/socket_functions.rst +++ b/doc/socket_functions.rst @@ -31,27 +31,31 @@ Socket functions system defaults. (It may choose whatever protocol is offered by the system.) ``oflags`` is a bitset which may contain ``O_NONBLOCK``, else must be 0. Upon success, a socket file descriptor is returned. Upon - failure, a negative errno code is returned. + failure, a negative errno code is returned. The socket will have + ``SOCK_CLOEXEC`` set by default if the platform supports it. ``HX_inet_listen`` The function first resolves ``host`` using ``getaddrinfo()` with ``AI_PASSIVE``, then using ``HX_socket_from_env`` looks in the environment for a matching socket to pick up, and otherwise uses the first result from getaddrinfo to create a new socket. Upon error, a - negative errno value is returned. + negative errno value is returned. The socket will have ``SOCK_CLOEXEC`` + set by default if the platform supports it. ``HX_local_listen`` The function creates a local system-specific socket. Using ``HX_socket_from_env``, it will attempt to pick up a matching socket from the environment, and otherwise create a new socket. Upon error, a - negative errno value is returned. + negative errno value is returned. The socket will have ``SOCK_CLOEXEC`` + set by default if the platform supports it. ``HX_socket_from_env`` The function looks up the current process's file descriptors for a socket that is listening and which matches the given addrinfo and (optionally) intf if the latter is not NULL``. Upon success, the fd number is returned, or -1 if no file descriptor matched. No errors are - signalled. + signalled. Before this function returns a file descriptor, it sets + ``SOCK_CLOEXEC``. ``HX_sockaddr_is_local`` Attempts to determine if the given socket address refers to a local |