STREAMS/UX for the HP 9000 Reference Manual

65
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Changes to Cloning
HP-UX Changes to Cloning
STREAMS/UX supports two methods of cloning. See the SVR4.2
STREAMS manual for more information about cloning. Some differences
exist between HP-UX cloning and SVR4.2 cloning.
The first cloning method uses a special clone major number, 72, to provide
cloning. For each cloneable device, a device file must exist that has the
clone major number of 72 and also has a minor number equal to the major
number of the real device. When an application opens this type of device
file, STREAMS/UX passes the driver open routine CLONEOPEN in the
sflag parameter. The driver allocates a minor number and returns a new
device number containing the true major number and the chosen minor
number. The driver uses either makdev or to create the new device number.
The second cloning method is useful for drivers which need to be able to
encode information in their minor numbers. This is not possible in the first
method, as the clone device file for that method must have as its minor
number the major number of the driver being cloned.
In the second cloning method, the driver designates a particular minor
number as its “clone” minor number. The driver open routine checks the
minor number portion of the device number parameter passed to it, and if it
is the clone minor number, the driver open routine allocates a minor number
and returns a new device number to the caller, in the same way as the first
cloning method described above. The returned device number must contain
both a major number and the new minor number. A driver using this cloning
method may also change the major number in the device number it returns.
However, the new major number must correspond to a STREAMS/UX
driver with the same streamtab structure as the driver associated with the
original major number. Also, on a multiprocessor system, if the original
driver was MP scalable, the new one must be too. Likewise, if the original
was UP emulation, the new one must be also.