diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 6c827c0..a7ab0f9 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -2493,6 +2493,16 @@ int iso_file_get_sort_weight(IsoFile *file); */ off_t iso_file_get_size(IsoFile *file); +/** + * Get the device id (major/minor numbers) of the given block or + * character device file. The result is undefined for other kind + * of special files, of first be sure iso_node_get_mode() returns either + * S_IFBLK or S_IFCHR. + * + * @since 0.6.6 + */ +dev_t iso_special_get_dev(IsoSpecial *special); + /** * Get the IsoStream that represents the contents of the given IsoFile. * diff --git a/libisofs/node.c b/libisofs/node.c index 9c8dee9..f1b26f9 100644 --- a/libisofs/node.c +++ b/libisofs/node.c @@ -906,6 +906,19 @@ IsoStream *iso_file_get_stream(IsoFile *file) return file->stream; } +/** + * Get the device id (major/minor numbers) of the given block or + * character device file. The result is undefined for other kind + * of special files, of first be sure iso_node_get_mode() returns either + * S_IFBLK or S_IFCHR. + * + * @since 0.6.6 + */ +dev_t iso_special_get_dev(IsoSpecial *special) +{ + return special->dev; +} + /** * Get the block lba of a file node, if it was imported from an old image. *