POSIX-layer data structures

Updated: April 19, 2023

There are three data structures that relate to the POSIX-layer support routines. As far as the base layer is concerned, you can use any data structures you want; it's the POSIX layer that requires you to conform to a certain content and layout. The benefits delivered by the POSIX layer are well worth this tiny constraint. As we'll see later, you can add your own content to the structures as well.

The three data structures are illustrated in the following diagram, showing some clients using a resource manager that happens to manifest two devices:

Figure 1. Data structures: the big picture.

The data structures (defined in <sys/iofunc.h>) are:

iofunc_ocb_t
Open Control Block structure: used to track client access to a particular service offered by a resource manager. This information is typically on a per-open basis.
iofunc_attr_t
Attributes structure: contains information on a per-resource basis
iofunc_mount_t
Mount structure: contains information on a per-mountpoint basis

When we talked about the I/O and connect tables, you saw the OCB and attributes structures—in the I/O tables, the OCB structure was the last parameter passed. The attributes structure was passed as the handle in the connect table functions (third argument). The mount structure is usually a global structure and is bound to the attributes structure “by hand” (in the initialization code that you supply for your resource manager).

Note: Be sure to #include <sys/iofunc.h> before <sys/resmgr.h>, or else the data structures won't be defined properly.