NNG_IPC_OPTIONS(5)
π NNG_IPC_OPTIONS π
okay bestie, welcome to the NNG Reference Manual page for nng_ipc_options β this is the one that spills all the tea about IPC-specific options π«β¨
πΈ NAME πΈ
nng_ipc_options β IPC-specific options π
π SYNOPSIS π
#include <nng/nng.h>
#define NNG_OPT_IPC_PEER_GID "ipc:peer-gid"
#define NNG_OPT_IPC_PEER_PID "ipc:peer-pid"
#define NNG_OPT_IPC_PEER_UID "ipc:peer-uid"
#define NNG_OPT_IPC_PEER_ZONEID "ipc:peer-zoneid"
#define NNG_OPT_IPC_PERMISSIONS "ipc:permissions"
#define NNG_OPT_IPC_SECURITY_DESCRIPTOR "ipc:security-descriptor"
β¨ DESCRIPTION β¨
This page is the master doc for all the standard options you can set or retrieve on objects that use IPC. no cap π
Quick PSA though: always use these option names through their symbolic definitions, bestie. like, don't go typing the raw strings, use the #defines. it's giving manners. π
so down below, each option gets its name plus the data type of the value hiding underneath it.
also β some of these options only make sense (or are only even supported) in certain contexts, and some come with extra access restrictions. the page tries its best to note those restrictions in each option's description. π
Note π«Ά Whether these options even exist is platform-specific, because IPC is implemented very differently on Windows vs POSIX systems. so like, vibe check your platform first.
NNG_OPT_IPC_PERMISSIONS π
(int) β this one is write-only, and you drop it on a listener to configure the permissions used on the UNIX domain socket that listener creates. it's POSIX-only, so Windows besties sit this one out π.
the value is an int and it represents the normal permission bits on a file β like 0600, which typically means read-write to the owner, and absolutely nothing for anyone else. iconic boundary-setting honestly.
the default is system-specific, and most often it's 0644.
Important β οΈ not every system actually validates these permissions! specifically, illumos and Solaris are known to just ignore these permission settings when connecting. so don't trust it blindly, bestie.
Note π normally a peer dialer needs both read and write permission to connect. go read your system's documentation for UNIX domain sockets for the full lore.
Note πΈ the umask of the process is not applied to these bits. nope. not a thing.
Tip π the best practice for limiting access is to put the socket in a directory that's writable only by the server, and only readable and searchable by clients. why? because all mainstream POSIX systems will refuse to let a client connect to a socket sitting in a directory where the client lacks search (execute) permission. periodt. that's the gatekeeping our security girlboss deserves. π₯
NNG_OPT_IPC_SECURITY_DESCRIPTOR πͺ
(PSECURITY_DESCRIPTOR) β also write-only, and this one is for Windows platforms, applied on listeners, to configure the SECURITY_DESCRIPTOR used when creating the underlying named pipe. π¦
the value is a pointer, PSECURITY_DESCRIPTOR, and it may only be applied to listeners that have not been started yet. like, once it's running? too late, bestie. π
π Common Platform Specific Options π
these are supported by this transport when the underlying platform supports them:
NNG_OPT_PEER_GID(also available asNNG_OPT_IPC_PEER_GID) πNNG_OPT_PEER_PID(also available asNNG_OPT_IPC_PEER_PID) πNNG_OPT_PEER_UID(also available asNNG_OPT_IPC_PEER_UID) πNNG_OPT_PEER_ZONEID(also available asNNG_OPT_IPC_PEER_ZONEID) β¨
π§ Inherited Options π§
generally, these option values are also available when appropriate for the context:
NNG_OPT_LOCADDRπNNG_OPT_REMADDRβ
π₯ SEE ALSO π₯
nng_dialer_get(3), nng_dialer_set(3), nng_listener_get(3), nng_listener_set(3), nng_pipe_get(3), nng_options(5) nng(7), nng_ipc(7)
and that's the whole page, bestie!! this was the NNG Reference Manual entry NNG_IPC_OPTIONS(5) β dated 2026-06-30. go forth and configure your IPC like the main character you are π
ππ¦
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms