\h'-\w'\\$1\ 'u'\\$1\ \c
.ft P
..
-.ie t .ds o \(bu
-.el .ds o o
+.ie t \{\
+. ds o \(bu
+. de VP
+. sp .4v
+..
+\}
+.el \{\
+. ds o o
+. de VP
+. sp
+..
+\}
.TH mdup 3 "4 January" "Straylight/Edgeware" "mLib utilities library"
.SH NAME
mdup \- renumber file descriptors
.SH SYNOPSIS
.nf
.B "#include <mLib/mdup.h>"
-
+.PP
.ta 2n
.B "typedef struct {"
.B " int cur;"
.B " int want;"
.B "} mdup_fd;"
-
+.PP
.BI "int mdup(mdup_fd *" v ", size_t " n ");"
.fi
.SH DESCRIPTION
int p_in[2] = P_INIT, p_out[2] = P_INIT, p_err[2] = P_INIT;
pid_t kid = -1;
int i;
-
+.VP
if (pipe(p_in) || pipe(p_out) || pipe(p_err)) goto error;
if ((kid = fork()) < 0) goto error;
if (!kid) {
pid_t kid = -1;
mdup_fd md[3];
int i;
-
+.VP
if (pipe(p_in) || pipe(p_out) || pipe(p_err)) goto error;
if ((kid = fork()) < 0) goto error;
if (!kid) {
.BR mLib (3).
.SH AUTHOR
Mark Wooding, <mdw@distorted.org.uk>
-