1/* System library. */
2
3#include <sys_defs.h>
4#include <unistd.h>
5#include <stdlib.h>
6
7/* Utility library. */
8
9#include <msg.h>
10#include <iostuff.h>
11
12/* Application-specific. */
13
14#include <master.h>
15#include <master_proto.h>
16
17int     master_flow_pipe[2];
18
19/* master_flow_init - initialize the flow control channel */
20
21void    master_flow_init(void)
22{
23    const char *myname = "master_flow_init";
24
25    if (pipe(master_flow_pipe) < 0)
26	msg_fatal("%s: pipe: %m", myname);
27
28    non_blocking(master_flow_pipe[0], NON_BLOCKING);
29    non_blocking(master_flow_pipe[1], NON_BLOCKING);
30
31    close_on_exec(master_flow_pipe[0], CLOSE_ON_EXEC);
32    close_on_exec(master_flow_pipe[1], CLOSE_ON_EXEC);
33}
34