#include <volmgt.h>
int volmgt_check(char *pathname);
This routine asks Volume Management to check the specified pathname and determine if new media has been inserted in that drive.
If a null pointer is passed in, then Volume Management will check each device it is managing that can be checked.
If new media is found, volmgt_check() tells Volume Management to initiate any "actions" specified in /etc/vold.conf (see vold.conf(4) ).
if (volmgt_check(NULL)) { (void) printf("Volume Management found media\n"); }
This would also request Volume Management to take whatever action was specified in /etc/vold.conf for any media found.
Since volmgt_check() returns 0 for two different cases (both when no media is found, and when an error occurs), it is up to the user to to check errno to differentiate the two, and to ensure that Volume Management is running.