Postfix3.3.1
master_proto.h
[詳解]
1 /*++
2 /* NAME
3 /* master_proto 3h
4 /* SUMMARY
5 /* master process protocol
6 /* SYNOPSIS
7 /* #include <master_proto.h>
8 /* DESCRIPTION
9 /* .nf
10 
11  /*
12  * Transport names. The master passes the transport name on the command
13  * line, and thus the name is part of the master to child protocol.
14  */
15 #define MASTER_XPORT_NAME_UNIX "unix" /* local IPC */
16 #define MASTER_XPORT_NAME_FIFO "fifo" /* local IPC */
17 #define MASTER_XPORT_NAME_INET "inet" /* non-local IPC */
18 #define MASTER_XPORT_NAME_PASS "pass" /* local IPC */
19 
20  /*
21  * Format of a status message sent by a child process to the process
22  * manager. Since this is between processes on the same machine we need not
23  * worry about byte order and word length.
24  */
25 typedef struct MASTER_STATUS {
26  int pid; /* process ID */
27  unsigned gen; /* child generation number */
28  int avail; /* availability */
30 
31 #define MASTER_GEN_NAME "GENERATION" /* passed via environment */
32 
33 #define MASTER_STAT_TAKEN 0 /* this one is occupied */
34 #define MASTER_STAT_AVAIL 1 /* this process is idle */
35 
36 extern int master_notify(int, unsigned, int); /* encapsulate status msg */
37 
38  /*
39  * File descriptors inherited from the master process. The flow control pipe
40  * is read by receive processes and is written to by send processes. If
41  * receive processes get too far ahead they will pause for a brief moment.
42  */
43 #define MASTER_FLOW_READ 3
44 #define MASTER_FLOW_WRITE 4
45 
46  /*
47  * File descriptors inherited from the master process. All processes that
48  * provide a given service share the same status file descriptor, and listen
49  * on the same service socket(s). The kernel decides what process gets the
50  * next connection. Usually the number of listening processes is small, so
51  * one connection will not cause a "thundering herd" effect. When no process
52  * listens on a given socket, the master process will. MASTER_LISTEN_FD is
53  * actually the lowest-numbered descriptor of a sequence of descriptors to
54  * listen on.
55  */
56 #define MASTER_STATUS_FD 5 /* shared channel to parent */
57 #define MASTER_LISTEN_FD 6 /* accept connections here */
58 
59 /* LICENSE
60 /* .ad
61 /* .fi
62 /* The Secure Mailer license must be distributed with this software.
63 /* AUTHOR(S)
64 /* Wietse Venema
65 /* IBM T.J. Watson Research
66 /* P.O. Box 704
67 /* Yorktown Heights, NY 10598, USA
68 /*--*/
69 
unsigned gen
Definition: master_proto.h:27
int master_notify(int, unsigned, int)
Definition: master_proto.c:65
struct MASTER_STATUS MASTER_STATUS