1media_getid(3VOLMGT)  Volume Management Library Functions media_getid(3VOLMGT)
2
3
4

NAME

6       media_getid - return the id of a piece of media
7

SYNOPSIS

9       cc [flag ...] file ...−lvolgmt [library ...]
10
11       #include <volmgt.h>
12
13
14
15       ulonglong_t media_getid(char *vol_path);
16
17

DESCRIPTION

19       This  function  is  obsolete.  The management of removable media by the
20       Volume Management feature, including vold, has been replaced  by  soft‐
21       ware  that  supports the Hardware Abstraction Layer (HAL). Programmatic
22       support for HAL is through the HAL APIs, which are  documented  on  the
23       HAL  web  site.  See hal(5). The return value of this function is unde‐
24       fined.
25
26
27       media_getid() returns the id of a piece  of  media.  Volume  management
28       must be running. See volmgt_running(3VOLMGT).
29

PARAMETERS

31       vol_path    Path to the block or character special device.
32
33

RETURN VALUES

35       The return from this function is undefined.
36

EXAMPLES

38       Example 1 Using media_getid()
39
40
41       The  following  example  first  checks if volume management is running,
42       then checks the volume management name space for path, and then returns
43       the id for the piece of media.
44
45
46         char *path;
47
48              ...
49
50         if (volmgt_running()) {
51              if (volmgt_ownspath(path)) {
52                   (void) printf("id of %s is %lld\n",
53                        path, media_getid(path));
54              }
55              }
56
57
58
59       If  a  program using media_getid() does not check whether or not volume
60       management is running, then any NULL return value will be ambiguous, as
61       it  could  mean that either volume management does not have path in its
62       name space, or volume management is not running.
63
64

ATTRIBUTES

66       See attributes(5)  for descriptions of the following attributes:
67
68
69
70
71       ┌─────────────────────────────┬─────────────────────────────┐
72       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
73       ├─────────────────────────────┼─────────────────────────────┤
74       │MT-Level                     │Safe                         │
75       ├─────────────────────────────┼─────────────────────────────┤
76       │Interface Stability          │Obsolete                     │
77       └─────────────────────────────┴─────────────────────────────┘
78

SEE ALSO

80       volmgt_ownspath(3VOLMGT),volmgt_running(3VOLMGT),attributes(5), hal(5)
81
82
83
84SunOS 5.11                        8 Mar 2007              media_getid(3VOLMGT)
Impressum