Postfix3.3.1
duplex_pipe.c
[詳解]
1 /*++
2 /* NAME
3 /* duplex_pipe 3
4 /* SUMMARY
5 /* local IPD
6 /* SYNOPSIS
7 /* #include <iostuff.h>
8 /*
9 /* int duplex_pipe(fds)
10 /* int *fds;
11 /* DESCRIPTION
12 /* duplex_pipe() uses whatever local primitive it takes
13 /* to get a two-way I/O channel.
14 /* DIAGNOSTICS
15 /* A null result means success. In case of error, the result
16 /* is -1 and errno is set to the appropriate number.
17 /* LICENSE
18 /* .ad
19 /* .fi
20 /* The Secure Mailer license must be distributed with this software.
21 /* AUTHOR(S)
22 /* Wietse Venema
23 /* IBM T.J. Watson Research
24 /* P.O. Box 704
25 /* Yorktown Heights, NY 10598, USA
26 /*--*/
27 
28 /* System libraries */
29 
30 #include <sys_defs.h>
31 #include <sys/socket.h>
32 #include <unistd.h>
33 
34 /* Utility library. */
35 
36 #include "iostuff.h"
37 #include "sane_socketpair.h"
38 
39 /* duplex_pipe - give me a duplex pipe or bust */
40 
41 int duplex_pipe(int *fds)
42 {
43 #ifdef HAS_DUPLEX_PIPE
44  return (pipe(fds));
45 #else
46  return (sane_socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
47 #endif
48 }
49 
int sane_socketpair(int domain, int type, int protocol, int *result)
int duplex_pipe(int *fds)
Definition: duplex_pipe.c:41