Extending the POSIX-Layer Data Structures

The iofunc_*() default functions operate on the assumption that you've used the default definitions for the context block and the attributes structures. This is a safe assumption for two reasons:

  1. The default context and attribute structures contain sufficient information for most applications.
  2. If the default structures don't hold enough information, you can encapsulate them within the structures that you've defined.

The default structures must be the first members of their respective superstructures, so that the iofunc_*() default functions can access them:

Figure 1. Encapsulating the POSIX-layer data structures.