debian/rules: Use `git' potty wrapper.
[qmail] / fd_copy.3
CommitLineData
2117e02e
MW
1.TH fd_copy 3
2.SH NAME
3fd_copy \- duplicate a descriptor
4.SH SYNTAX
5.B #include <fd.h>
6
7int \fBfd_copy\fP(\fIto\fR,\fIfrom\fR);
8
9int \fIto\fR;
10.br
11int \fIfrom\fR;
12.SH DESCRIPTION
13.B fd_copy
14copies
15descriptor
16.I from
17to descriptor
18.IR to .
19If
20.I to
21was already open,
22.B fd_copy
23closes it.
24.B fd_copy
25always leaves
26.I from
27intact;
28if
29.I to
30and
31.I from
32are the same number,
33.B fd_copy
34does nothing.
35
36.B fd_copy
37returns 0 on success, -1 on error.
38.B fd_copy
39does not guarantee that
40.I to
41will remain open, if it was open, in case of error.
42.SH "SEE ALSO"
43dup(2),
44fd_move(3)