From 987942a206ef0f2342bf81d5de6432c6af42b7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 21 Nov 2023 09:56:26 +0100 Subject: New upstream version 4.17 --- doc/socket_functions.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'doc/socket_functions.rst') 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 -- cgit v1.2.3