Could you point me in right direction? Now I am looking system call g_io_getattr..
I do not want to call subprocess.
The return would be e.g. 'da0', 'da1' or 'ada0'...
Could you point me in right direction? Now I am looking system call g_io_getattr..
I do not want to call subprocess.
The return would be e.g. 'da0', 'da1' or 'ada0'...
You are most likely going to want to be working with FreeBSD's libgeom - specifically geom_gettree(). The source to freebsd's partedit - shows it being used and the resulting structure being iterated through in the read_geom_mesh and related functions in order to get a list of the disks. What appears to be the source of the geom program also demonstrates some usage of the geom_gettree function and iterating through its returned structure.