Postfix3.3.1
timed_ipc.c
[詳解]
1 /*++
2 /* NAME
3 /* timed_ipc 3
4 /* SUMMARY
5 /* enforce IPC timeout on stream
6 /* SYNOPSIS
7 /* #include <time_ipc.h>
8 /*
9 /* void timed_ipc_setup(stream)
10 /* VSTREAM *stream;
11 /* DESCRIPTION
12 /* timed_ipc() enforces on the specified stream the timeout as
13 /* specified via the \fIipc_timeout\fR configuration parameter:
14 /* a read or write operation fails if it does not succeed within
15 /* \fIipc_timeout\fR seconds. This deadline exists as a safety
16 /* measure for communication between mail subsystem programs,
17 /* and should never be exceeded.
18 /* DIAGNOSTICS
19 /* Panic: sanity check failed. Fatal error: deadline exceeded.
20 /* LICENSE
21 /* .ad
22 /* .fi
23 /* The Secure Mailer license must be distributed with this software.
24 /* AUTHOR(S)
25 /* Wietse Venema
26 /* IBM T.J. Watson Research
27 /* P.O. Box 704
28 /* Yorktown Heights, NY 10598, USA
29 /*--*/
30 
31 /* System library. */
32 
33 #include <sys_defs.h>
34 
35 /* Utility library. */
36 
37 #include <msg.h>
38 #include <vstream.h>
39 
40 /* Global library. */
41 
42 #include "mail_params.h"
43 #include "timed_ipc.h"
44 
45 /* timed_ipc_setup - enable ipc with timeout */
46 
47 void timed_ipc_setup(VSTREAM *stream)
48 {
49  if (var_ipc_timeout <= 0)
50  msg_panic("timed_ipc_setup: bad ipc_timeout %d", var_ipc_timeout);
51 
52  vstream_control(stream,
55 }
int var_ipc_timeout
Definition: mail_params.c:255
#define CA_VSTREAM_CTL_TIMEOUT(v)
Definition: vstream.h:163
NORETURN msg_panic(const char *fmt,...)
Definition: msg.c:295
void timed_ipc_setup(VSTREAM *stream)
Definition: timed_ipc.c:47
#define CA_VSTREAM_CTL_END
Definition: vstream.h:155
void vstream_control(VSTREAM *stream, int name,...)
Definition: vstream.c:1372