diff options
| -rw-r--r-- | sys/kern/subr_diskslice.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index f6736cfba969..8120e550f3a0 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -407,6 +407,19 @@ dsioctl(dev, cmd, data, flags, sspp) *(struct disklabel *)data = *lp; return (0); + case DIOCGSECTORSIZE: + if (lp == NULL) + return (EINVAL); + *(u_int *)data = lp->d_secsize; + return (0); + + case DIOCGMEDIASIZE: + if (lp == NULL) + return (EINVAL); + *(off_t *)data = (off_t)lp->d_partitions[dkpart(dev)].p_size * + lp->d_secsize; + return (0); + case DIOCGPART: if (lp == NULL) return (EINVAL); |
