Chapter 41. apis, Standard networking, Enhanced select() – Comtrol eCos User Manual

Page 585: Apis

Advertising
background image

Chapter 41. APIs

Standard networking

The APIs for the standard networking calls such as

socket()

,

recv()

and so on, are in header files relative to

the top-level include directory, within the standard subdirectories as conventionally found in

/usr/include

. For

example:

install/include/arpa/tftp.h

install/include/netinet/tcpip.h

install/include/sys/socket.h

install/include/sys/socketvar.h

install/include/sys/sockio.h

Enhanced Select()

The network stack supports an extension to the standard select semantics which allows all threads that are waiting
to be restarted even if the select conditions are not satisfied.

The standard select() API:

int

select

(int nfd,

fd_set

in, fd_set

out, fd_set

ex,

struct timeval

tv);

does not support the restart.

The additional API:

int

cyg_select_with_abort

(int nfd,

fd_set

in, fd_set

out, fd_set

ex,

struct timeval

tv)

behaves exactly as select() with the additional feature that a call to

void

cyg_select_abort

(void)

will cause all threads waiting in any

cyg_select_with_abort()

call to cease waiting and continue execution.

481

Advertising