You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manvendra Bhangui edited this page Dec 31, 2023
·
2 revisions
NAME
fd_copy - duplicate a descriptor
SYNTAX
#include <fd.h>
int fd_copy(to,from);
int to;
int from;
DESCRIPTION
fd_copy copies descriptor from to descriptor to. If to was
already open, fd_copy closes it. fd_copy always leaves from
intact; if to and from are the same number, fd_copy does
nothing.
fd_copy returns 0 on success, -1 on error. fd_copy does not
guarantee that to will remain open, if it was open, in case of error.