1 MEDIA_GETID(3VOLMGT)  Volume Management Library Functions MEDIA_GETID(3VOLMGT)
   2 
   3 
   4 
   5 NAME
   6        media_getid - return the id of a piece of media
   7 
   8 SYNOPSIS
   9        cc [flag ...] file ...-lvolmgt [library ...]
  10 
  11        #include <volmgt.h>
  12 
  13 
  14 
  15        ulonglong_t media_getid(char *vol_path);
  16 
  17 
  18 DESCRIPTION
  19        This function is obsolete. The management of removable media by the
  20        Volume Management feature, including vold, has been replaced by
  21        software that supports the Hardware Abstraction Layer (HAL).
  22        Programmatic support for HAL is through the HAL APIs, which are
  23        documented on the HAL web site. See hal(5). The return value of this
  24        function is undefined.
  25 
  26 
  27        media_getid() returns the id of a piece of media. Volume management
  28        must be running. See volmgt_running(3VOLMGT).
  29 
  30 PARAMETERS
  31        vol_path
  32                    Path to the block or character special device.
  33 
  34 
  35 RETURN VALUES
  36        The return from this function is undefined.
  37 
  38 EXAMPLES
  39        Example 1 Using media_getid()
  40 
  41 
  42        The following example first checks if volume management is running,
  43        then checks the volume management name space for path, and then returns
  44        the id for the piece of media.
  45 
  46 
  47          char *path;
  48 
  49               ...
  50 
  51          if (volmgt_running()) {
  52               if (volmgt_ownspath(path)) {
  53                    (void) printf("id of %s is %lld\n",
  54                         path, media_getid(path));
  55               }
  56               }
  57 
  58 
  59 
  60        If a program using media_getid() does not check whether or not volume
  61        management is running, then any NULL return value will be ambiguous, as
  62        it could mean that either volume management does not have path in its
  63        name space, or volume management is not running.
  64 
  65 
  66 ATTRIBUTES
  67        See attributes(5)  for descriptions of the following attributes:
  68 
  69 
  70 
  71 
  72        +--------------------+-----------------+
  73        |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
  74        +--------------------+-----------------+
  75        |MT-Level            | Safe            |
  76        +--------------------+-----------------+
  77        |Interface Stability | Obsolete        |
  78        +--------------------+-----------------+
  79 
  80 SEE ALSO
  81        volmgt_ownspath(3VOLMGT), volmgt_running(3VOLMGT), attributes(5),
  82        hal(5)
  83 
  84 
  85 
  86                                  March 8, 2007            MEDIA_GETID(3VOLMGT)