ipc_pair_mem - creates a pair of mutually connected IPC sockets
int ipc_pair_mem(void *mem, int s);
IPC protocol is a bytestream protocol (i.e. data can be sent via bsend() and received via brecv()) for transporting data among processes on the same machine. It is an equivalent to POSIX AF_LOCAL sockets.
This function creates a pair of mutually connected IPC sockets, in user-supplied memory. The memory is passed in mem argument. It must be at least IPC_PAIR_SIZE bytes long and can be deallocated only after both sockets are closed. Unless you are hyper-optimizing use ipc_pair() instead.
The sockets can be cleanly shut down using ipc_close() function.
Zero in case of success. On error, it returns -1 and sets errno to one of the values below.
int s; char mem[IPC_PAIR_SIZE]; int rc = ipc_pair_mem(mem, s);