-
-
Notifications
You must be signed in to change notification settings - Fork 1
fd_move.3
Manvendra Bhangui edited this page Dec 31, 2023
·
2 revisions
fd_move - renumber a descriptor
#include <fd.h>
int fd_move(to,from);
int to;
int from;
fd_move moves descriptor from to descriptor to. If to was already open, fd_move closes it. If the move is successful, fd_move closes from. Exception: if to and from are the same number, fd_move does nothing.
fd_move returns 0 on success, -1 on error.
dup(2) fd_copy(3),