Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strmod_add(2) [osf1 man page]

strmod_add(2)							System Calls Manual						     strmod_add(2)

NAME
strmod_add - Adds STREAMS modules and drivers SYNOPSIS
#include <sys/stream.h> dev_t strmod_add ( dev_t devno, struct streamtab *streamtab, struct streamadm *streamadm); PARAMETERS
The device number (cdevsw slot) to use when adding a driver. If NODEV is supplied, the first available slot is used. This parameter is ignored for modules. A pointer to the streamtab structure that contains the entry points. The actual streamtab structure has to be allo- cated permanently in the driver's data space (as specified by System V Release 3.2). A pointer to the streamadm structure that contains the administration parameters for the STREAMS module or driver. The actual streamadm structure is needed only for the duration of the call. It does not have to be allocated permanently by the caller. DESCRIPTION
The strmod_add() interface is used to configure STREAMS modules and drivers into the kernel. Specifically, it allows STREAMS drivers to add entry points in character device switch tables. Modules are added to the STREAMS modules switch. When adding a driver only, strmod_add() takes a device number, which is used to determine the device switch slot for the entry points. A STREAMS driver can supply NODEV instead of a device number. In this case, strmod_add() finds the first available device switch slot and returns the number actually used. If a device switch slot is already in use or if there are no slots available, NODEV is returned. The streamtab parameter is a pointer to a traditional (System V Release 3.2) streamtab structure. The structure contains pointers to entry points for the module's read and write queue routines. The streamadm points to a streamadm structure. The streamadm structure provides additional information that is required under Tru64 UNIX. NOTES
The device number can be constructed from the major number through the makedev macro, which is defined in /usr/include/sys/types.h. RETURN VALUES
Upon successful completion, strmod_add() returns the device number associated with the device switch table. Otherwise, it returns NODEV. RELATED INFORMATION
Data Structures: streamadm(4) Routines: strmod_del(2) delim off strmod_add(2)

Check Out this Related Man Page

sad(7)							 Miscellaneous Information Manual						    sad(7)

NAME
sad - STREAMS Administrative Driver SYNOPSIS
... DESCRIPTION
The driver provides an interface to the facility using the function. As an interface, the driver enables administrative tasks to be per- formed on STREAMS modules and drivers. By specifying the command parameter to the function, an administrator can configure information for a device, get information on a device, or check a list of modules. fildes is a file descriptor obtained by opening using command specifies the administrative function to be performed. arg points to a data structure. If command is or arg points to a struct of type If command is arg points to a struct of type Security Restrictions The is restricted to superusers or users with the privilege. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. ioctl Commands The commands used to perform administrative functions on a STREAMS module or driver are specified by the following commands: Allows you to configure information for a device. The arg parameter points to a structure (defined in the header file), whose members are as follows: Allows you to specify the type of configuration to perform. This field can have the following values: Configures all minor devices. Configures a range of minor devices. Configures a single minor device. Clears the previous settings. Specify only the and fields when using this command. If a previous entry specified set the field to 0 (zero). If a previous entry was specified as set the field to the lowest minor device number in the range. Specifies the major device number. Specifies the minor device number. Specifies the range of minor devices. Specifies the number of modules to push. This number must be no more than which is defined in Additionally, this number must not exceed Specifies, in order, the array of modules to push. Lets you use the driver to obtain configuration information for a device by setting the and fields of the structure (see the command) to the major and minor device numbers of the device being queried. arg should point to a struct of type Upon successful completion, the structure contains all of the information used to configure the device. Values of 0 (zero) will appear in any unused entry in the module list. Enables you to check a list of modules. For example, you can determine if a specific module has been installed. The arg parameter points to a structure (defined in the header file), whose members are as follows: Specifies the number of entries you have allocated in an array. Points to the array of module names. The structure (also in the header file) is as follows: where specifies the array of module names. If the array is valid, the command returns a value of 0 (zero). If the array contains an invalid module name, the com- mand returns a value of 1. Upon failure, the command returns a value of -1. Notes As a STREAMS driver, also supports the normal STREAMS In this form, specify the field in the structure to either or The field points to the structure (see the command in the section). Refer to the streamio(7) reference page for further details. RETURN VALUE
Unless specified otherwise, upon successful completion, the commands return a value of 0 (zero). Otherwise, a value of -1 is returned. ERRORS
If any of the following conditions occur, the commands return the corresponding value: The specified major/minor device number pair has already been configured. The arg parameter points outside the allocated address space. The major device number is invalid, the number of modules is invalid, or the list of module names is invalid. The device is not configured for This value is returned from a command. A internal data structure cannot be allocated. The major device does not represent a STREAMS driver. The field is less than the field when the command is or the minor device specified in a command does not exist. Only a superuser or user with privilege is allowed to execute the The arg parameter points outside the allocated address space. The major device number is invalid. The device is not configured for The major device does not represent a STREAMS driver. The arg parameter points outside the allocated address space. The list of module names is invalid. SEE ALSO
autopush(1M), ioctl(2), open(2), privileges(5), streamio(7). sad(7)
Man Page