summaryrefslogtreecommitdiff
path: root/doc/socket_functions.rst
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-11-21 09:56:28 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-11-21 09:56:28 +0100
commit45e1231149779c363c9abb78cc09e21d047c463f (patch)
tree111b91a23e747bb2c9df60b0170914cbbd74dec3 /doc/socket_functions.rst
parentd391e80c7378e6604c8f84538f27df8b915ebd2a (diff)
parent987942a206ef0f2342bf81d5de6432c6af42b7e7 (diff)
Update upstream source from tag 'upstream/4.17'
Update to upstream version '4.17' with Debian dir da192eda54f0b421cbc1b9ba383659593db8d3db
Diffstat (limited to 'doc/socket_functions.rst')
-rw-r--r--doc/socket_functions.rst12
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