dosfstools  4.2
About: dosfstools are utilities to create, check and label (MS-DOS) FAT filesystems.
  Fossies Dox: dosfstools-4.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

device_info.h
Go to the documentation of this file.
1 #ifndef DEVICE_INFO_H
2 #define DEVICE_INFO_H
3 
4 enum device_type {
5  TYPE_UNKNOWN, /* type could not be determined */
6  TYPE_BAD, /* neither file nor block device */
7  TYPE_FILE, /* image file rather than device */
8  TYPE_VIRTUAL, /* block devices like LVM or RAID volumes */
9  TYPE_REMOVABLE, /* removable disk device */
10  TYPE_FIXED /* fixed disk device */
11 };
12 
13 struct device_info {
14  enum device_type type;
15 
16  /*
17  * partition number if detected
18  * 0 = whole disk device (including unpartitioned image file)
19  * -1 = could not be determined
20  */
21  int partition;
22 
23  /*
24  * whether partitions or device mapper devices or any other kind of
25  * children use this device
26  * 1 = yes
27  * 0 = no
28  * -1 = could not be determined
29  */
31 
32  /*
33  * detected geometry, or -1 if unknown
34  */
37  long long geom_start;
38  long long geom_size;
39 
40  /*
41  * detected sector size or -1 if unknown
42  */
44 
45  /*
46  * size in bytes, or -1 if unknown
47  */
48  long long size;
49 };
50 
51 
52 extern int device_info_verbose;
53 
54 int get_device_info(int fd, struct device_info *info);
55 int is_device_mounted(const char *path);
56 
57 #endif
int device_info_verbose
Definition: device_info.c:68
int is_device_mounted(const char *path)
Definition: device_info.c:321
int get_device_info(int fd, struct device_info *info)
Definition: device_info.c:282
device_type
Definition: device_info.h:4
@ TYPE_REMOVABLE
Definition: device_info.h:9
@ TYPE_FILE
Definition: device_info.h:7
@ TYPE_BAD
Definition: device_info.h:6
@ TYPE_VIRTUAL
Definition: device_info.h:8
@ TYPE_UNKNOWN
Definition: device_info.h:5
@ TYPE_FIXED
Definition: device_info.h:10
static int fd
Definition: io.c:56
long long geom_start
Definition: device_info.h:37
enum device_type type
Definition: device_info.h:14
int geom_sectors
Definition: device_info.h:36
long long size
Definition: device_info.h:48
long long geom_size
Definition: device_info.h:38
int sector_size
Definition: device_info.h:43
int geom_heads
Definition: device_info.h:35
int has_children
Definition: device_info.h:30