1volmgt_check(3VOLMGT) Volume Management Library Functionsvolmgt_check(3VOLMGT)
2
3
4

NAME

6       volmgt_check - have Volume Management check for media
7

SYNOPSIS

9       cc [ flag... ] file... -lvolmgt [ library ... ]
10       #include <volmgt.h>
11
12       int volmgt_check(char *pathname);
13
14

DESCRIPTION

16       This  function  is  obsolete.  The management of removable media by the
17       Volume Management feature, including vold, has been replaced  by  soft‐
18       ware  that  supports the Hardware Abstraction Layer (HAL). Programmatic
19       support for HAL is through the HAL APIs, which are  documented  on  the
20       HAL  web  site.  See hal(5). The return value of this function is unde‐
21       fined.
22
23
24       This routine asks volume Management to check the specified pathname and
25       determine if new media has been inserted in that drive.
26
27
28       If  a null pointer is passed in, then Volume Management will check each
29       device it is managing that can be checked.
30
31
32       If new media is found, volmgt_check() tells volume management to initi‐
33       ate appropriate actions.
34

RETURN VALUES

36       The return from this function is undefined.
37

ERRORS

39       This routine can fail, returning 0, if a stat(2) or open(2) of the sup‐
40       plied pathname fails, or if any of the following is true:
41
42       ENXIO    volume management is not running.
43
44
45       EINTR    An interrupt signal was detected while checking for media.
46
47

EXAMPLES

49       Example 1 Checking If Any New Media Is Inserted
50
51
52       To check if any drive managed by volume management has  any  new  media
53       inserted in it:
54
55
56         if (volmgt_check(NULL)) {
57                 (void) printf("Volume management found media\n");
58         }
59
60
61
62       This  would  also request volume management to take whatever action was
63       appropriate for the new media.
64
65

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                     │MT-Safe                      │
76       └─────────────────────────────┴─────────────────────────────┘
77

SEE ALSO

79       volcheck(1),  open(2),  stat(2),   volmgt_inuse(3VOLMGT),   volmgt_run‐
80       ning(3VOLMGT), attributes(5), hal(5)
81

NOTES

83       Since  volmgt_check()  returns  0 for two different cases (both when no
84       media is found, and when an error occurs), it is  up  to  the  user  to
85       check errno to differentiate the two, and to ensure that volume manage‐
86       ment is running.
87
88
89
90SunOS 5.11                        8 Mar 2007             volmgt_check(3VOLMGT)
Impressum