diff options
Diffstat (limited to 'fd_move.3')
| -rw-r--r-- | fd_move.3 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/fd_move.3 b/fd_move.3 new file mode 100644 index 0000000..94aa1b7 --- /dev/null +++ b/fd_move.3 | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | .TH fd_move 3 | ||
| 2 | .SH NAME | ||
| 3 | fd_move \- renumber a descriptor | ||
| 4 | .SH SYNTAX | ||
| 5 | .B #include <fd.h> | ||
| 6 | |||
| 7 | int \fBfd_move\fP(\fIto\fR,\fIfrom\fR); | ||
| 8 | |||
| 9 | int \fIto\fR; | ||
| 10 | .br | ||
| 11 | int \fIfrom\fR; | ||
| 12 | .SH DESCRIPTION | ||
| 13 | .B fd_move | ||
| 14 | moves | ||
| 15 | descriptor | ||
| 16 | .I from | ||
| 17 | to descriptor | ||
| 18 | .IR to . | ||
| 19 | If | ||
| 20 | .I to | ||
| 21 | was already open, | ||
| 22 | .B fd_move | ||
| 23 | closes it. | ||
| 24 | If the move is successful, | ||
| 25 | .B fd_move | ||
| 26 | closes | ||
| 27 | .IR from . | ||
| 28 | Exception: | ||
| 29 | if | ||
| 30 | .I to | ||
| 31 | and | ||
| 32 | .I from | ||
| 33 | are the same number, | ||
| 34 | .B fd_move | ||
| 35 | does nothing. | ||
| 36 | |||
| 37 | .B fd_move | ||
| 38 | returns 0 on success, -1 on error. | ||
| 39 | .SH "SEE ALSO" | ||
| 40 | dup(2), | ||
| 41 | fd_copy(3) | ||
