#include <fcntl.h>
#include <sys/mount.h>
int main( int argc, char** argv ){
if( argc != 2 ) return -1;
int f = open( argv[1], O_RDONLY );
if( f < 1 ) return -2;
return ioctl( f, BLKRRPART );
}
That or you could just sleep for a while, checking for the existence of /dev/nbdXpX -- but I am an impatient bastard..
No comments:
Post a Comment