summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid
diff options
context:
space:
mode:
authorKarel Zak2010-03-10 15:50:45 +0100
committerKarel Zak2010-03-10 15:50:45 +0100
commit56e961e270fd4b34015a688781dcc6b970c0e318 (patch)
tree2a7edf83d70753ec6d0850f8d759b4ccc45c38d9 /shlibs/blkid
parentliblkid: move getsize.c code to lib/ (diff)
downloadkernel-qcow2-util-linux-56e961e270fd4b34015a688781dcc6b970c0e318.tar.gz
kernel-qcow2-util-linux-56e961e270fd4b34015a688781dcc6b970c0e318.tar.xz
kernel-qcow2-util-linux-56e961e270fd4b34015a688781dcc6b970c0e318.zip
libblkid: add blkid_probe_get_{offset,fd} functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid')
-rw-r--r--shlibs/blkid/src/blkid.h.in3
-rw-r--r--shlibs/blkid/src/blkid.sym6
-rw-r--r--shlibs/blkid/src/probe.c24
3 files changed, 31 insertions, 2 deletions
diff --git a/shlibs/blkid/src/blkid.h.in b/shlibs/blkid/src/blkid.h.in
index edeb8b571..07001a3a5 100644
--- a/shlibs/blkid/src/blkid.h.in
+++ b/shlibs/blkid/src/blkid.h.in
@@ -198,8 +198,11 @@ extern int blkid_probe_set_device(blkid_probe pr, int fd,
extern dev_t blkid_probe_get_devno(blkid_probe pr);
extern blkid_loff_t blkid_probe_get_size(blkid_probe pr);
+extern blkid_loff_t blkid_probe_get_offset(blkid_probe pr);
extern unsigned int blkid_probe_get_sectorsize(blkid_probe pr);
+extern int blkid_probe_get_fd(blkid_probe pr);
+
/*
* superblocks probing
*/
diff --git a/shlibs/blkid/src/blkid.sym b/shlibs/blkid/src/blkid.sym
index dfde68913..a80e87399 100644
--- a/shlibs/blkid/src/blkid.sym
+++ b/shlibs/blkid/src/blkid.sym
@@ -120,7 +120,9 @@ global:
*/
BLKID_2.18 {
global:
- blkid_probe_all_removable;
- blkid_partlist_devno_to_partition;
blkid_partition_get_flags;
+ blkid_partlist_devno_to_partition;
+ blkid_probe_all_removable;
+ blkid_probe_get_fd;
+ blkid_probe_get_offset;
} BLKID_2.17;
diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
index 4ca215b08..6d61386c1 100644
--- a/shlibs/blkid/src/probe.c
+++ b/shlibs/blkid/src/probe.c
@@ -991,6 +991,30 @@ blkid_loff_t blkid_probe_get_size(blkid_probe pr)
}
/**
+ * blkid_probe_get_offset:
+ * @pr: probe
+ *
+ * This function returns offset of probing area as defined by blkid_probe_set_device().
+ *
+ * Returns: offset in bytes or -1 in case of error.
+ */
+blkid_loff_t blkid_probe_get_offset(blkid_probe pr)
+{
+ return pr ? pr->off : -1;
+}
+
+/**
+ * blkid_probe_get_fd:
+ * @pr: probe
+ *
+ * Returns: file descriptor for assigned device/file.
+ */
+int blkid_probe_get_fd(blkid_probe pr)
+{
+ return pr ? pr->fd : -1;
+}
+
+/**
* blkid_probe_get_sectorsize:
* @pr: probe
*