summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/probe.c
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/src/probe.c
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/src/probe.c')
-rw-r--r--shlibs/blkid/src/probe.c24
1 files changed, 24 insertions, 0 deletions
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
*