File Descriptor Programming Interface
3-11
Sockets and Stream IO API
Return Value
Should be treated as a void function. The true return value is dependent on the
implementation of the macro.
Description
This function is used to remove a file descriptor from a file descriptor set, typi-
cally after the file descriptor has been “processed” in a loop that continuously
checks a file descriptor set.
Test to See if a File Descriptor is Included in a File Descriptor Set
FD_ISSET
Syntax
void FD_ISSET( int fd, fd_set *pFdSet );
Parameter(s)
fd
File descriptor to check
pFdSet
Pointer to fd_set data type
Return Value
Returns an int value which should be treated as a TRUE/FALSE condition.
Description
This function returns TRUE if the supplied file descriptor is contained in the in-
dicated file descriptor set. This function is typically called after a call to fdSe-
lect() to determine on what file descriptors select has detected activity.
Copy a File Descriptor Set
FD_COPY
Syntax
void FD_COPY( fd_set *pFdSetSRC, fd_set *pFdSetDST );
Parameter(s)
pFdSetSRC
Pointer to fd_set to copy
pFdSetDST
Pointer to fd_set to write copied data
Return Value
nothing
Description
This function is called to make a copy of a file descriptor set. This is typically
done is a set needs to be modified, but this original information needs to be
maintained.
Clear (Initialize) a File Descriptor Set
FD_ZERO
Syntax
void FD_ZERO( fd_set *pFdSet );
Parameter(s)
pFdSet
Pointer to fd_set to initialize
Return Value
nothing
Description
This function is called clear all bits in a file descriptor set. This should be the
first call made on a newly declared fd_set variable.