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

  man pages->OpenBSD man pages -> hotplug (4)              
Title
Content
Arch
Section
 

HOTPLUG(4)

Contents


NAME    [Toc]    [Back]

     hotplug - devices hot plugging

SYNOPSIS    [Toc]    [Back]

     pseudo-device hotplug 1

     #include <sys/types.h>
     #include <sys/device.h>
     #include <sys/hotplug.h>

DESCRIPTION    [Toc]    [Back]

     The hotplug pseudo-device passes device attachment  and  detachment events
     to userland.  When a device attaches or detaches, the corresponding event
     is queued.  The events can then be obtained from  the  queue
through the
     read(2) call on the /dev/hotplug device file.  Once an event
has been
     read, it's deleted from the queue.  The event  queue  has  a
limited size
     and if it's full all new events will be dropped.  Each event
is described
     with the following structure declared in the <sys/hotplug.h>
header file:

           struct hotplug_event {
                   int              he_type;        /* event type
*/
                   enum  devclass    he_devclass;     /*   device
class         */
                   char            he_devname[16]; /* device name
*/
           };

     The he_type field describes the event type and can be either
     HOTPLUG_DEVAT for device attachment or HOTPLUG_DEVDT for detachment.  The
     he_devclass field describes the device  class.   All  device
classes can be
     found in the <sys/device.h> header file:

           enum devclass {
                   DV_DULL,        /* generic, no special info */
                   DV_CPU,         /* CPU (carries resource  utilization) */
                   DV_DISK,        /* disk drive (label, etc) */
                   DV_IFNET,       /* network interface */
                   DV_TAPE,        /* tape device */
                   DV_TTY          /* serial line interface */
           };

     The  he_devname is a device name including unit number, e.g.
sd1.

     Only one structure can be read per call.  If  there  are  no
events in the
     queue, the read(2) call will block until an event appears.

DIAGNOSTICS    [Toc]    [Back]

     hotplug:  event lost, queue full  New events will be dropped
until all
     pending events have been read.

SEE ALSO    [Toc]    [Back]

      
      
     read(2), hotplugd(8)

HISTORY    [Toc]    [Back]

     The hotplug device first appeared in OpenBSD 3.6.

AUTHORS    [Toc]    [Back]

     The hotplug driver was written by Alexander Yurchenko
     <grange@openbsd.org>.

OpenBSD     3.6                          March      30,      2004
[ Back ]
 Similar pages
Name OS Title
hotplugd OpenBSD devices hot plugging monitor daemon
hotplugd OpenBSD devices hot plugging monitor daemon
hotplugd OpenBSD devices hot plugging monitor daemon
hotplugd OpenBSD devices hot plugging monitor daemon
hotplugd OpenBSD devices hot plugging monitor daemon
hilinfo OpenBSD provides information on HIL devices
usbhidctl FreeBSD manipulate USB HID devices
usbhidctl OpenBSD manipulate USB HID devices
ioctl Tru64 Control devices
input IRIX input devices
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service