IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


fd_set Struct Reference
[Socket type definitions]

Socket descriptor set. More...


Detailed Description

Socket descriptor set, used by the API function select( ).

This data structure provides a bit field to specify which sockets to monitor and which sockets events occur in the select() API. Each bit corresponds to a socket. The socket descriptor is used to provide the mapping between bits and sockets. For example for a socket with descriptor zero, this socket will be represented by bit 0 in this field, which will be the most significant bit of first fd_mask in the array. A set of macros are provided in the Beck C-library for manipulating these bit fields:

FD_SET (n, p) :
Sets bit 'n' in fd_set at pointer 'p' to 1.

FD_CLR (n, p) :
Zeroes bit 'n' in fd_set at pointer 'p'.

FD_ISSET (n, p):
Tests bit 'n' in fd_set at pointer 'p'.

FD_ZERO (p) :
Clears all bits in fd_set at pointer 'p'.

FD_COPY (src, dest) :
Copies object at pointer 'src' into the object at pointer 'dest'. The intent here is that both of these pointers reference a fd_set structure, but the compiler will not type check this for you.


Also the socket iterator function FD_Next() is available to sequence through a set of sockets.

Since:
SC2x3 V1.00 - CLIB V1.00

Data Fields

fd_mask fds_bits [MAX_BECK_SOCKETS/NFDBITS]





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:39 2017 by Doxygen 1.6.1