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