libblkid Reference Manual | ||||
---|---|---|---|---|
Top | Description |
typedef blkid_loff_t; char * blkid_devno_to_devname (dev_t devno
); int blkid_devno_to_wholedisk (dev_t dev
,char *diskname
,size_t len
,dev_t *diskdevno
); blkid_loff_t blkid_get_dev_size (int fd
); int blkid_get_library_version (const char **ver_string
,const char **date_string
); int blkid_parse_tag_string (const char *token
,char **ret_type
,char **ret_val
); int blkid_parse_version_string (const char *ver_string
); int blkid_send_uevent (const char *devname
,const char *action
); #define BLKID_VERSION #define BLKID_DATE #define BLKID_FLTR_NOTIN #define BLKID_FLTR_ONLYIN #define BLKID_DEV_CREATE #define BLKID_DEV_FIND #define BLKID_DEV_NORMAL #define BLKID_DEV_VERIFY #define BLKID_PARTS_ENTRY_DETAILS #define BLKID_PARTS_FORCE_GPT #define BLKID_PARTS_MAGIC #define BLKID_PROBREQ_LABEL #define BLKID_PROBREQ_LABELRAW #define BLKID_PROBREQ_SECTYPE #define BLKID_PROBREQ_TYPE #define BLKID_PROBREQ_USAGE #define BLKID_PROBREQ_UUID #define BLKID_PROBREQ_UUIDRAW #define BLKID_PROBREQ_VERSION #define BLKID_SUBLKS_DEFAULT #define BLKID_SUBLKS_LABEL #define BLKID_SUBLKS_LABELRAW #define BLKID_SUBLKS_MAGIC #define BLKID_SUBLKS_SECTYPE #define BLKID_SUBLKS_TYPE #define BLKID_SUBLKS_USAGE #define BLKID_SUBLKS_UUID #define BLKID_SUBLKS_UUIDRAW #define BLKID_SUBLKS_VERSION #define BLKID_USAGE_CRYPTO #define BLKID_USAGE_FILESYSTEM #define BLKID_USAGE_OTHER #define BLKID_USAGE_RAID
char * blkid_devno_to_devname (dev_t devno
);
This function finds the pathname to a block device with a given device number.
|
device number |
Returns : |
a pointer to allocated memory to the pathname on success, and NULL on failure. |
int blkid_devno_to_wholedisk (dev_t dev
,char *diskname
,size_t len
,dev_t *diskdevno
);
This function uses sysfs to convert the devno
device number to the *name*
of the whole disk. The function DOES NOT return full device name. The dev
argument could be partition or whole disk -- both is converted.
For example: sda1, 0x0801 --> sda, 0x0800
For conversion to the full disk *path* use blkid_devno_to_devname()
, for
example:
1 2 3 4 5 6 7 8 9 10 11 |
dev_t dev = 0x0801, disk; // sda1 = 8:1 char *diskpath, diskname[32]; blkid_devno_to_wholedisk(dev, diskname, sizeof(diskname), &disk); diskpath = blkid_devno_to_devname(disk); // print "0x0801: sda, /dev/sda, 8:0 printf("0x%x: %s, %s, %d:%d\n", dev, diskname, diskpath, major(disk), minor(disk)); free(diskpath); |
|
device number |
|
buffer to return diskname (or NULL) |
|
diskname buffer size (or 0) |
|
pointer to returns devno of entire disk (or NULL) |
Returns : |
0 on success or -1 in case of error. |
blkid_loff_t blkid_get_dev_size (int fd
);
|
file descriptor |
Returns : |
size (in bytes) of the block device or size of the regular file or 0. |
int blkid_get_library_version (const char **ver_string
,const char **date_string
);
|
returns relese version (!= SONAME version) |
|
returns date |
Returns : |
release version code. |
int blkid_parse_tag_string (const char *token
,char **ret_type
,char **ret_val
);
int blkid_parse_version_string (const char *ver_string
);
|
version string (e.g. "2.16.0") |
Returns : |
release version code. |
int blkid_send_uevent (const char *devname
,const char *action
);
|
absolute path to the device |
|
event string |
Returns : |
-1 in case of failure, or 0 on success. |
#define BLKID_PROBREQ_LABEL BLKID_SUBLKS_LABEL
BLKID_PROBREQ_LABEL
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_LABELRAW BLKID_SUBLKS_LABELRAW
BLKID_PROBREQ_LABELRAW
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_SECTYPE BLKID_SUBLKS_SECTYPE
BLKID_PROBREQ_SECTYPE
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_TYPE BLKID_SUBLKS_TYPE
BLKID_PROBREQ_TYPE
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_USAGE BLKID_SUBLKS_USAGE
BLKID_PROBREQ_USAGE
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_UUID BLKID_SUBLKS_UUID
BLKID_PROBREQ_UUID
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_UUIDRAW BLKID_SUBLKS_UUIDRAW
BLKID_PROBREQ_UUIDRAW
is deprecated and should not be used in newly-written code.
#define BLKID_PROBREQ_VERSION BLKID_SUBLKS_VERSION
BLKID_PROBREQ_VERSION
is deprecated and should not be used in newly-written code.
#define BLKID_SUBLKS_LABELRAW (1 << 2) /* read and define LABEL_RAW result value*/
#define BLKID_SUBLKS_SECTYPE (1 << 6) /* define compatible fs type (second type) */
#define BLKID_SUBLKS_UUIDRAW (1 << 4) /* read and define UUID_RAW result value */