aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-03 14:28:44 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-03 15:14:45 -0700
commitafd555af4fba0acbf16c174dd9dece24181a1a38 (patch)
tree9d49fec85c58ecad9a034a98e092627968494bc0 /src/core
parentfa986e725f08e30eab68e16765b2cf71613b871c (diff)
downloadnng-afd555af4fba0acbf16c174dd9dece24181a1a38.tar.gz
nng-afd555af4fba0acbf16c174dd9dece24181a1a38.tar.bz2
nng-afd555af4fba0acbf16c174dd9dece24181a1a38.zip
fixes #383 Would like peerid for IPC
We offer uid, gid, process id, and even zone id where we have them. Docs and tests are provided.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/platform.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/platform.h b/src/core/platform.h
index 671556d8..6e7acdbf 100644
--- a/src/core/platform.h
+++ b/src/core/platform.h
@@ -341,6 +341,21 @@ extern void nni_plat_ipc_pipe_send(nni_plat_ipc_pipe *, nni_aio *);
// The platform may modify the iovs.
extern void nni_plat_ipc_pipe_recv(nni_plat_ipc_pipe *, nni_aio *);
+// nni_plat_ipc_pipe_get_peer_uid obtains the peer user id, if possible.
+// NB: Only POSIX systems support user IDs.
+extern int nni_plat_ipc_pipe_get_peer_uid(nni_plat_ipc_pipe *, uint64_t *);
+
+// nni_plat_ipc_pipe_get_peer_gid obtains the peer group id, if possible.
+// NB: Only POSIX systems support group IDs.
+extern int nni_plat_ipc_pipe_get_peer_gid(nni_plat_ipc_pipe *, uint64_t *);
+
+// nni_plat_ipc_pipe_get_peer_pid obtains the peer process id, if possible.
+extern int nni_plat_ipc_pipe_get_peer_pid(nni_plat_ipc_pipe *, uint64_t *);
+
+// nni_plat_ipc_pipe_get_peer_zoneid obtains the peer zone id, if possible.
+// NB: Only illumos & SunOS systems have the notion of "zones".
+extern int nni_plat_ipc_pipe_get_peer_zoneid(nni_plat_ipc_pipe *, uint64_t *);
+
//
// UDP support. UDP is not connection oriented, and only has the notion
// of being bound, sendto, and recvfrom. (It is possible to set up a