|
The following example first checks if Volume Management is running, then checks the volume management name space for path, and then returns the id for
the piece of media.
|
char *path;
...
if (volmgt_running()) {
if (volmgt_ownspath(path)) {
(void) printf("id of %s is %lld\n",
path, media_getid(path));
}
}
|
If a program using media_getid() does not check whether or not Volume Management is running, then any NULL return value will be ambiguous,
as it could mean that either Volume Management does not have path in its name space, or Volume Management is not running.
|