device_nodes(3K) DG/UX R4.11MU05 device_nodes(3K)
NAME
devicenodes: fssubmitdevpathnamerequest - create or delete
device nodes
SYNOPSIS
#include "/usr/src/uts/aviion/ii/ifs.h"
void fssubmitdevpathnamerequest (
fsdevrequestoperationenumtype operation, /*READONLY*/
...
)
DESCRIPTION
This routine is used by device drivers to submit a request to create
or delete a /dev entry. If the root file system is already mounted,
the request will be processed immediately. Otherwise, the request is
added to a queue for processing as soon as the root file system is
mounted.
The operation parameter is an enumeration value describing the opera
tion to be performed: FsDevRequestOperationCreate to create a de
vice node, or FsDevRequestOperationDelete to delete one.
There are one or more variadic function arguments; these are pointers
to pathname component structures that together describe the device
node to be created or deleted. The first argument describes the
first component of the node's pathname (e.g., the dev in
/dev/dsk/root); the second argument describes the second pathname
component; etc. The argument list must be terminated by the pointer
value FSDEVPATHNAMENULLCOMPONENT. Each pathname component struc
ture looks like:
typedef struct {
chartype name[MAXNAMELEN];
dffilemodetype modebits;
uint32type userid;
uint32type groupid;
iodevicenumbertype device;
}
fsdevpathnamecomponenttype;
The fields in this structure are relevant only for
FsDevRequestOperationCreate operations, except as noted below.
The fields are:
name The filename of the component in the pathname of the
device node that is being created or deleted. For ex
ample, the filename of the first component of a request
to create or delete /dev/dsk/root would be "dev", while
the filename of the third component of that request
would be "root".
modebits The initial mode bits of the pathname component being
created, including both access permissions (read,
write, execute, etc.) and file type information (direc
tory vs. character-special file vs. block-special
file).
userid The user ID to be assigned to pathname component being
created.
groupid The group ID to be assigned to pathname component being
created.
device The device number of the node being created. This
field is only valid if the component being created is a
block-special or character-special file.
The attributes (mode bits, user ID and group ID) of intermediate
directory components are relevant only during
FsDevRequestOperationCreate operations, and then only for in
termediate directories that don't already exist. Once created,
such directories' attributes will not be changed by any subse
quent create requests. During FsDevRequestOperationDelete
operations, only the device node component of the request is
deleted; all intermediate directories are unaffected.
For convenience, a number of predefined pathname component struc
tures have been created in the FS subsystem. They include
fsdevdevpathnamecomponent (used to specify /dev itself),
fsdevpdskpathnamecomponent (used to specify the pdsk subdi
rectory of /dev), and many other structures with names of the
form fsdevdirectorypathnamecomponent.
DIAGNOSTICS
Requests to create device nodes that already exist will result in er
ror messages to the system console.
EXAMPLES
The following example creates a character-special device node named
/dev/net/devicenodename with devicenumber as the node's device
number:
charptrtype devicenodename;
iodevicenumbertype devicenumber;
fsdevpathnamecomponenttype nodecomponent;
nodecomponent.modebits = SIFCHR | SIRUSR | SIWUSR;
nodecomponent.userid = FSSTANDARDDEVICEUSERID;
nodecomponent.groupid = FSSTANDARDDEVICEGROUPID;
nodecomponent.device = devicenumber;
miscformatline (nodecomponent.name, usizeof (nodecomponent.name),
"%s", devicenodename);
fssubmitdevpathnamerequest (FsDevRequestOperationCreate,
&fsdevdevpathnamecomponent,
&fsdevnetpathnamecomponent,
&nodecomponent,
FSDEVPATHNAMENULLCOMPONENT);
SEE ALSO
deviceconfiguration(3K).
Programming in the DG/UX Kernel Environment.
Licensed material--property of copyright holder(s)