*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> clone (7)              
Title
Content
Arch
Section
 

Contents


 clone(7)                                                           clone(7)




 NAME    [Toc]    [Back]
      clone - opens a major and minor device pair on a STREAMS driver

 DESCRIPTION    [Toc]    [Back]
      The clone driver is a "pass through" device driver that allows other
      drivers to select unique minor device numbers on each open().  In
      effect, the driver passes an open operation through to the other
      driver.  This mechanism allows for multiple instantiations of a
      driver, each with a different minor number, through a single device
      file.

      When the clone driver is opened, it is passed a major and minor device
      number by the operating system.  The major number is the clone
      driver's major number (72), and the minor number is the major number
      of the driver the user wishes to clone (referred to here as the target
      driver). The clone driver calls the open routine of the target driver
      with the CLONEOPEN flag which specifies a clone open.  The target
      driver's open routine allocates an unused minor number.  The target
      driver must use makedev to make a new device number for the newly
      created device, and must set *devp to the new device number returned
      by makedev.  The new device number is returned to the clone open
      through *devp.  The clone open then returns to the user a file
      descriptor that points to the new instantiation of the target driver.

      The echo driver is an example of a clonable driver.

    Notes    [Toc]    [Back]
      It is not possible to do multiple opens of a device with the same
      major and minor number using the clone driver.  This is because the
      clone driver is only given the major number of the driver to be
      cloned, and that driver will then select a minor number which has not
      been opened.

      When called with a pathname which corresponds to the clonable driver,
      stat() will return different results than fstat() when it is called on
      a file descriptor returned from open() of the same clonable driver
      pathname.

 RETURN VALUES    [Toc]    [Back]
      If the clone driver is given an invalid minor number, or if the driver
      indicated is not a clonable driver, the open() fails and errno is set
      to [ENXIO].

 SEE ALSO    [Toc]    [Back]
      open(2), fstat(2).


 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
clone IRIX open any minor device on a STREAMS driver
cddevsuppl Tru64 Sets and gets the major and minor numbers of
cd_setdevmap Tru64 set mappings of major/minor numbers of a
cd_getdevmap Tru64 get mappings of major/minor numbers of a
vdevgone OpenBSD revoke all specified minor numbered vnodes for a device
tels HP-UX STREAMS Telnet slave (pseudo-terminal) driver, STREAMS Telnet master driver (used by telnetd only), respective
telm HP-UX STREAMS Telnet slave (pseudo-terminal) driver, STREAMS Telnet master driver (used by telnetd only), respective
ifnet Tru64 STREAMS ifnet module for bridging STREAMS device drivers to sockets
dlb Tru64 STREAMS pseudodevice driver for bridging BSD Drivers to STREAMS
dlpi Tru64 STREAMS pseudodevice driver for bridging BSD Drivers to STREAMS
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service