diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /fd_copy.3 | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'fd_copy.3')
| -rw-r--r-- | fd_copy.3 | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/fd_copy.3 b/fd_copy.3 new file mode 100644 index 0000000..758a7e7 --- /dev/null +++ b/fd_copy.3 | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | .TH fd_copy 3 | ||
| 2 | .SH NAME | ||
| 3 | fd_copy \- duplicate a descriptor | ||
| 4 | .SH SYNTAX | ||
| 5 | .B #include <fd.h> | ||
| 6 | |||
| 7 | int \fBfd_copy\fP(\fIto\fR,\fIfrom\fR); | ||
| 8 | |||
| 9 | int \fIto\fR; | ||
| 10 | .br | ||
| 11 | int \fIfrom\fR; | ||
| 12 | .SH DESCRIPTION | ||
| 13 | .B fd_copy | ||
| 14 | copies | ||
| 15 | descriptor | ||
| 16 | .I from | ||
| 17 | to descriptor | ||
| 18 | .IR to . | ||
| 19 | If | ||
| 20 | .I to | ||
| 21 | was already open, | ||
| 22 | .B fd_copy | ||
| 23 | closes it. | ||
| 24 | .B fd_copy | ||
| 25 | always leaves | ||
| 26 | .I from | ||
| 27 | intact; | ||
| 28 | if | ||
| 29 | .I to | ||
| 30 | and | ||
| 31 | .I from | ||
| 32 | are the same number, | ||
| 33 | .B fd_copy | ||
| 34 | does nothing. | ||
| 35 | |||
| 36 | .B fd_copy | ||
| 37 | returns 0 on success, -1 on error. | ||
| 38 | .B fd_copy | ||
| 39 | does not guarantee that | ||
| 40 | .I to | ||
| 41 | will remain open, if it was open, in case of error. | ||
| 42 | .SH "SEE ALSO" | ||
| 43 | dup(2), | ||
| 44 | fd_move(3) | ||
