qlibs:

Section: Misc. Reference Manual Pages (fd)
Updated: 3
Index Return to Main Contents
 

NAME

fd - duplicate, move or close a file descriptor  

SYNTAX

#include "fd.h"

int fd_copy(int to,int from);
int fd_move(int to,int from);
int fd_coe(int fd);  

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 does not guarantee that to will remain open, if it was open, in case of error.

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_coe closes fd.  

RETURN CODES

fd_copy, fd_move, and fd_coe return 0 on success, and -1 on error.  

SEE ALSO

dup(2), fcntl(2)


 

Index

NAME
SYNTAX
DESCRIPTION
RETURN CODES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 14:55:39 GMT, December 15, 2024