1volmgt_symname(3VOLMGT)Volume Management Library Functionvsolmgt_symname(3VOLMGT)
2
3
4

NAME

6       volmgt_symname,  volmgt_symdev - convert between Volume Management sym‐
7       bolic names, and the devices that correspond to them
8

SYNOPSIS

10       cc [ flag... ] file... -lvolmgt [ library... ]
11       #include <volmgt.h>
12
13       char *volmgt_symname(char *pathname);
14
15
16       char *volmgt_symdev(char *symname);
17
18

DESCRIPTION

20       This function is obsolete. The management of  removable  media  by  the
21       Volume  Management  feature, including vold, has been replaced by soft‐
22       ware that supports the Hardware Abstraction Layer  (HAL).  Programmatic
23       support  for  HAL  is through the HAL APIs, which are documented on the
24       HAL web site. See hal(5). The return value of this  function  is  unde‐
25       fined.
26
27
28       These  two  routines  compliment each other, translating between Volume
29       Management's symbolic name for a device, called a symname, and the /dev
30       pathname for that same device.
31
32
33       volmgt_symname() converts a supplied /dev pathname to a symname, Volume
34       Management's idea of that device's symbolic name.
35
36
37       volmgt_symdev() does the opposite conversion, converting between a sym‐
38       name,  Volume  Management's idea of a device's symbolic name for a vol‐
39       ume, to the /dev pathname for that device.
40

RETURN VALUES

42       The return from this function is undefined.
43

ERRORS

45       volmgt_symname() can fail,  returning  a  null  string  pointer,  if  a
46       stat(2) of the supplied pathname fails, or if an open(2) of /dev/volctl
47       fails, or if any of the following is true:
48
49       ENXIO    Volume Management is not running.
50
51
52       EINTR    An interrupt signal was detected while trying to  convert  the
53                supplied pathname to a symname.
54
55
56
57       volmgt_symdev()  can fail if an open(2) of /dev/volctl fails, or if any
58       of the following is true:
59
60       ENXIO    Volume Management is not running.
61
62
63       EINTR    An interrupt signal was detected while trying to  convert  the
64                supplied symname to a /dev pathname.
65
66

EXAMPLES

68       Example 1 Testing Floppies
69
70
71       The  following tests how many floppies Volume Management currently sees
72       in floppy drives (up to 10):
73
74
75         for (i=0; i < 10; i++) {
76                 (void) sprintf(path, "floppy%d", i);
77                 if (volmgt_symdev(path) != NULL) {
78                         (void) printf("volume %s is in drive %d\n",
79                             path, i);
80                 }
81         }
82
83
84       Example 2 Finding The Symbolic Name
85
86
87       This code finds out what symbolic name (if any) Volume  Management  has
88       for /dev/rdsk/c0t6d0s2:
89
90
91         if ((nm = volmgt_symname("/dev/rdsk/c0t6d0s2")) == NULL) {
92                 (void) printf("path not managed\n");
93         } else {
94                 (void) printf("path managed as %s\n", nm);
95         }
96
97

ATTRIBUTES

99       See attributes(5) for descriptions of the following attributes:
100
101
102
103
104       ┌─────────────────────────────┬─────────────────────────────┐
105       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
106       ├─────────────────────────────┼─────────────────────────────┤
107       │MT-Level                     │MT-Safe                      │
108       ├─────────────────────────────┼─────────────────────────────┤
109       │Interface Stability          │Obsolete                     │
110       └─────────────────────────────┴─────────────────────────────┘
111

SEE ALSO

113       open(2),    stat(2),   free(3C),   malloc(3C),   volmgt_check(3VOLMGT),
114       volmgt_inuse(3VOLMGT), volmgt_running(3VOLMGT), attributes(5), hal(5)
115
116
117
118SunOS 5.11                        8 Mar 2007           volmgt_symname(3VOLMGT)
Impressum