mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's
so that newfs works on dvd-rw/dvd-ram again..
This commit is contained in:
parent
8278014bce
commit
fe78f9d47c
2 changed files with 11 additions and 2 deletions
|
|
@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
|
|||
#include <sys/cdio.h>
|
||||
#include <sys/cdrio.h>
|
||||
#include <sys/dvdio.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/ctype.h>
|
||||
|
|
@ -1032,6 +1033,14 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
|
|||
error = EINVAL;
|
||||
break;
|
||||
|
||||
case DIOCGMEDIASIZE:
|
||||
*(off_t *)addr = cdp->disk_size * cdp->block_size;
|
||||
break;
|
||||
|
||||
case DIOCGSECTORSIZE:
|
||||
*(u_int *)addr = cdp->block_size;
|
||||
break;
|
||||
|
||||
default:
|
||||
error = ENOTTY;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,8 +318,8 @@ struct acd_softc {
|
|||
struct acd_softc **driver; /* softc's of changer slots */
|
||||
int slot; /* this instance slot number */
|
||||
time_t timestamp; /* this instance timestamp */
|
||||
int disk_size; /* size of current media */
|
||||
int block_size; /* blocksize currently used */
|
||||
u_int disk_size; /* size of current media */
|
||||
u_int block_size; /* blocksize currently used */
|
||||
struct devstat *stats; /* devstat entry */
|
||||
dev_t dev; /* device place holders */
|
||||
#ifndef BURN_BRIDGES
|
||||
|
|
|
|||
Loading…
Reference in a new issue