STREAMS-UX Programmer's Guide (February 2007)
Appendix D
251
D STREAMS Administrative Driver
Overview
This appendix discusses the STREAMS Administrative Driver (SAD).
SAD
The STREAMS Administrative Driver (SAD) provides an interface to the autopush facility using the ioctl
(2) function. As an interface, the sad driver enables administrative tasks to be performed on STREAMS
modules and drivers. By specifying the command parameter to the ioctl (2) function, an administrator can
configure autopush information for a device, get information on a device, or check a list of modules.
Synopsis
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/sad.h>
#include <sys/stropts.h>
int ioctl(int fd, int command, void *arg);
fd: File descriptor obtained by opening /dev/sad via the open (2) system call.
command: Administrative function to be performed. The supported commands are: SAD_SAP, SAD_GAP,
SAD_VML.
arg: Points to a strapush data structure if the IOCTL command is SAD_SAP or SAD_GAP, points
to a str_list data structure if the IOCTL command is SAD_VML.
SAD_SAP
Allows the superuser to configure autopush information for a device. The
arg
parameter points to a strapush
structure, defined in <sys/sad.h>, and shown here:
struct strapush {
uint sap_cmd;
long sap_major;
long sap_minor;
long sap_lastminor;
long sap_npush;
char sap_list[MAXAPUSH][FMNAMESZ+1];
};
sap_cmd: Allows the user to specify the type of configuration to perform. This field can have the
following values:
SAP_ALL Configures all minor devices.
SAP_RANGE Configures a range of minor devices.
SAP_ONE Configures a single minor device.