aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_debug.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-30 11:45:36 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-30 12:12:07 -0800
commit9c6b2929d8019dcc11935550bc3520ae39c2964e (patch)
treec8311a91c02e7f78dbc8c26d8456b373ef33b5f4 /src/platform/posix/posix_debug.c
parent60c9c1c4054a5dbb3c1cad2068e1a793789618ff (diff)
downloadnng-9c6b2929d8019dcc11935550bc3520ae39c2964e.tar.gz
nng-9c6b2929d8019dcc11935550bc3520ae39c2964e.tar.bz2
nng-9c6b2929d8019dcc11935550bc3520ae39c2964e.zip
fixes #863 socket activation: for TCP and IPC (POSIX only)
This introduces a new option "NNG_OPT_LISTEN_FD", understood by TCP, TLS, and (on POSIX systems) IPC. This option is used to pass a file descriptor or handle (Windows) that is already listening (ready for ACCEPT to be called). For TCP and TLS, the socket must be of type AF_INET or AF_INET6, and for IPC it must be of type AF_UNIX.
Diffstat (limited to 'src/platform/posix/posix_debug.c')
-rw-r--r--src/platform/posix/posix_debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/platform/posix/posix_debug.c b/src/platform/posix/posix_debug.c
index 912000cc..3c0a6604 100644
--- a/src/platform/posix/posix_debug.c
+++ b/src/platform/posix/posix_debug.c
@@ -90,6 +90,9 @@ static struct {
{ ENFILE, NNG_ENOFILES },
{ EMFILE, NNG_ENOFILES },
{ EEXIST, NNG_EEXIST },
+#ifdef ENOTSOCK
+ { ENOTSOCK, NNG_EINVAL },
+#endif
// must be last
{ 0, 0 },
// clang-format on