POSIX-Layer Data Structures

The resource manager library defines (in <sys/iofunc.h>) several key structures that are related to the POSIX-layer support routines:

The Open Control Block (OCB) maintains the state information about a particular session involving a client and a resource manager. For example, it's created during open() handling and exists until a close() is performed. It contains data such as the current position into a file (the lseek() offset) and is used by the iofunc layer helper functions.
Since a resource manager may be responsible for more than one resource (e.g., devc-ser* may be responsible for /dev/ser1, /dev/ser2, /dev/ser3, etc.), the attributes structure holds data on a per-resource basis. If the resource is a file, there's typically one attribute structure per name. This structure contains such items as the user and group ID of the owner of the resource, the last modification time, etc.
Contains per-mountpoint data items that are global to the entire mount device. Filesystem (block I/O device) managers use this structure; a resource manager for a device typically won't have a mount structure.
Note: Be sure to #include <sys/iofunc.h> before <sys/resmgr.h>, or else the data structures won't be defined properly.

For information about what's in these structures, see their entries in the C Library Reference.

This picture may help explain their interrelationships:

Figure 1. How the data structures link to each other.

Here are some other examples that illustrate how these structures are used:

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 these reasons:

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

Figure 3. Encapsulating the POSIX-layer data structures.