From afd555af4fba0acbf16c174dd9dece24181a1a38 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 3 May 2018 14:28:44 -0700 Subject: 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. --- src/core/platform.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/core') 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 -- cgit v1.2.3-70-g09d2