summaryrefslogtreecommitdiff
path: root/sysutils/xentools41/files/blk_netbsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/xentools41/files/blk_netbsd.c')
-rw-r--r--sysutils/xentools41/files/blk_netbsd.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/sysutils/xentools41/files/blk_netbsd.c b/sysutils/xentools41/files/blk_netbsd.c
deleted file mode 100644
index 81076a25a4d..00000000000
--- a/sysutils/xentools41/files/blk_netbsd.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <inttypes.h>
-#include <sys/ioctl.h>
-#include <sys/disklabel.h>
-#include "tapdisk.h"
-#include "blk.h"
-
-int blk_getimagesize(int fd, uint64_t *size)
-{
- int rc;
- struct disklabel dl;
-
- *size = 0;
- rc = ioctl(fd, DIOCGDINFO, &dl);
- if (rc) {
- DPRINTF("ERR: DIOCGDINFO failed, couldn't stat image");
- return -EINVAL;
- }
-
- *size = dl.d_secsize * dl.d_secpercyl;
-
- return 0;
-}
-
-int blk_getsectorsize(int fd, uint64_t *sector_size)
-{
- int rc;
- struct disklabel dl;
-
- *sector_size = DEV_BSIZE;
- rc = ioctl(fd, DIOCGDINFO, &dl);
- if (rc) {
- DPRINTF("ERR: DIOCGDINFO failed, couldn't stat image");
- return 0; /* fallback to DEV_BSIZE */
- }
-
- *sector_size = dl.d_secsize;
- return 0;
-}
-