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