Installs streams modules and drivers.
The str_install utility adds or removes Portable Streams Environment (PSE) drivers and modules from the internal tables of PSE. The extension is pinned when added and unpinned when removed (see the pincode kernel service). It uses a configuration structure to provide sufficient information to perform the specified command.
This utility is part of STREAMS Kernel Extensions.
The configuration structure, strconf_t, is defined as follows:
typedef struct {
char *sc_name;
struct streamtab *sc_str;
int sc_open_stylesc_flags;
int sc_major;
int sc_sqlevel;
caddr_t sc_sqinfo;
} strconf_t;
The elements of the strconf_t structure are defined as follows:
Element | Description |
---|---|
sc_name | Specifies the name of the extension in the internal tables of PSE. For modules, this name is installed in the fmodsw table and is used for I_PUSH operations. For drivers, this name is used only for reporting with the scls and strinfo commands. |
sc_str | Points to a streamtab structure. |
sc_open_stylesc_flags | Specifies the style of the driver or module open routine.
The acceptable values are:
If the module is multiprocessor-safe, the following flag should be added by using the bitwise OR operator:
If the module uses callback functions that need to be protected against interrupts (non-interrupt-safe callback functions) for the timeout or bufcall utilities, the following flag should be added by using the bitwise OR operator:
This flag is automatically set by STREAMS if the module is not multiprocessor-safe.
By default STREAMS service routine runs under interrupt context (INTOFFL3). If Streams drivers or modules want to execute their service routine under process context (INTBASE), they need to set this flag.
|
sc_major | Specifies the major number of the device. |
sc_sqlevel | Reserved for future use. Specifies the synchronization level
to be used by PSE. There are seven levels of synchronization:
|
sc_sqinfo | Specifies an optional group name. This field is only used when the SQLVL_ELSEWHERE arbitrary synchronization level is set; all modules having the same name belong to one group. The name size is limited to eight characters. |
Item | Description |
---|---|
cmd | Specifies which operation to perform. Acceptable values are:
|
conf | Points to a strconf_t structure, which contains all the necessary information to successfully load and unload a PSE kernel extension. |
On successful completion, the str_install utility returns a value of 0. Otherwise, it returns an error code.
On failure, the str_install utility returns one of the following error codes:
Code | Description |
---|---|
EBUSY | The PSE kernel extension is already in use and cannot be unloaded. |
EEXIST | The PSE kernel extension already exists in the system. |
EINVAL | A parameter contains an unacceptable value. |
ENODEV | The PSE kernel extension could not be loaded. |
ENOENT | The PSE kernel is not present and could not be unloaded. |
ENOMEM | Not enough memory for the extension could be allocated and pinned. |
ENXIO | PSE is currently locked for use. |