File: fd_copy.3

package info (click to toggle)
qmail 1.01-5
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 2,188 kB
  • ctags: 1,711
  • sloc: ansic: 13,993; makefile: 1,914; perl: 448; sh: 377
file content (44 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.TH fd_copy 3
.SH NAME
fd_copy \- duplicate a descriptor
.SH SYNTAX
.B #include <fd.h>

int \fBfd_copy\fP(\fIto\fR,\fIfrom\fR);

int \fIto\fR;
.br
int \fIfrom\fR;
.SH DESCRIPTION
.B fd_copy
copies 
descriptor
.I from
to descriptor
.IR to .
If
.I to
was already open,
.B fd_copy
closes it.
.B fd_copy
always leaves
.I from
intact;
if
.I to
and
.I from
are the same number,
.B fd_copy
does nothing.

.B fd_copy
returns 0 on success, -1 on error.
.B fd_copy
does not guarantee that
.I to
will remain open, if it was open, in case of error.
.SH "SEE ALSO"
dup(2),
fd_move(3)