Chapter 17

team bbl


17.3

A declaration specifies the attributes (such as the data type) of a set of identifiers. If the declaration also causes storage to be allocated, it is called a definition.

In the opend.h header, we declare the three global variables with the extern storage class. These declarations do not cause storage to be allocated for the variables. In the main.c file, we define the three global variables. Sometimes, we'll also initialize a global variable when we define it, but we typically let the C default apply.

17.5

Both select and poll return the number of ready descriptors as the value of the function. The loop that goes through the client array can terminate when the number of ready descriptors have been processed.

    team bbl



    Advanced Programming in the UNIX Environment
    Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)
    ISBN: 0321525949
    EAN: 2147483647
    Year: 2005
    Pages: 370

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net