#include <sys/disk.h>
sys/disk.h
Definitions
ioctl description
------------------------------------- ---------------------------------------
DKIOCEJECT eject media
DKIOCSYNCHRONIZE flush media
DKIOCFORMAT format media
DKIOCGETFORMATCAPACITIES get media's formattable capacities
DKIOCGETBLOCKSIZE get media's block size
DKIOCGETBLOCKCOUNT get media's block count
DKIOCGETFIRMWAREPATH get media's firmware path
DKIOCISFORMATTED is media formatted?
DKIOCISWRITABLE is media writable?
DKIOCREQUESTIDLE idle media
DKIOCUNMAP delete unused data
DKIOCGETLOCATION get device's physical location
DKIOCGETMAXBLOCKCOUNTREAD get maximum block count for reads
DKIOCGETMAXBLOCKCOUNTWRITE get maximum block count for writes
DKIOCGETMAXBYTECOUNTREAD get maximum byte count for reads
DKIOCGETMAXBYTECOUNTWRITE get maximum byte count for writes
DKIOCGETMAXSEGMENTCOUNTREAD get maximum segment count for reads
DKIOCGETMAXSEGMENTCOUNTWRITE get maximum segment count for writes
DKIOCGETMAXSEGMENTBYTECOUNTREAD get maximum segment byte count for reads
DKIOCGETMAXSEGMENTBYTECOUNTWRITE get maximum segment byte count for writes
DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT get minimum segment alignment in bytes
DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT get maximum segment width in bits
DKIOCGETFEATURES get device's feature set
DKIOCGETPHYSICALBLOCKSIZE get device's block size
DKIOCGETCOMMANDPOOLSIZE get device's queue depth
DKIOCGETPROVISIONSTATUS get device's block provision status
DKIOCGETIOMINSATURATIONBYTECOUNT get minimum byte count to saturate storage bandwidth
DKIOCGETERRORDESCRIPTION get description of any drive error
DKIOCGETMAXSWAPWRITE get maximum swap file write per day in bytes
macroDK_FEATURE_FORCE_UNIT_ACCESS
#define DK_FEATURE_FORCE_UNIT_ACCESS 0x00000001
macroDK_ENCRYPTION_TYPE_AES_CBC
#define DK_ENCRYPTION_TYPE_AES_CBC 1
macroDK_ENCRYPTION_TYPE_AES_XEX
#define DK_ENCRYPTION_TYPE_AES_XEX 2
macroDK_ENCRYPTION_TYPE_AES_XTS
#define DK_ENCRYPTION_TYPE_AES_XTS 3
macroDK_TIER_MASK
#define DK_TIER_MASK 0xC0
macroDK_TIER_SHIFT
#define DK_TIER_SHIFT 6
macroDK_TIER_TO_PRIORITY
#define DK_TIER_TO_PRIORITY(tier) (((tier) << DK_TIER_SHIFT) | ~DK_TIER_MASK)
macroDK_PRIORITY_TO_TIER
#define DK_PRIORITY_TO_TIER(priority) ((priority) >> DK_TIER_SHIFT)
structdk_physical_extent_t
| uint64_t | offset | |
| uint64_t | length | |
| uint8_t[12] | reserved0128 | reserved, clear to zero |
| dev_t | dev |
typedefdk_physical_extent_t
typedef struct dk_physical_extent_t dk_physical_extent_t;
structdk_set_tier_t
| dk_extent_t * | extents | |
| uint32_t | extentsCount | |
| uint8_t | tier | |
| uint8_t[3] | reserved0104 | reserved, clear to zero |
typedefdk_set_tier_t
typedef struct dk_set_tier_t dk_set_tier_t;
macroDKIOCSETBLOCKSIZE
#define DKIOCSETBLOCKSIZE _IOW('d', 24, uint32_t)
macroDKIOCGETBSDUNIT
#define DKIOCGETBSDUNIT _IOR('d', 27, uint32_t)
macroDKIOCISSOLIDSTATE
#define DKIOCISSOLIDSTATE _IOR('d', 79, uint32_t)
macroDKIOCISVIRTUAL
#define DKIOCISVIRTUAL _IOR('d', 72, uint32_t)
macroDKIOCGETBASE
#define DKIOCGETBASE _IOR('d', 73, uint64_t)
macroDKIOCGETTHROTTLEMASK
#define DKIOCGETTHROTTLEMASK _IOR('d', 80, uint64_t)
macroDKIOCLOCKPHYSICALEXTENTS
#define DKIOCLOCKPHYSICALEXTENTS _IO('d', 81)
macroDKIOCGETPHYSICALEXTENT
#define DKIOCGETPHYSICALEXTENT _IOWR('d', 82, dk_physical_extent_t)
macroDKIOCUNLOCKPHYSICALEXTENTS
#define DKIOCUNLOCKPHYSICALEXTENTS _IO('d', 83)
macroDKIOCSETTIER
#define DKIOCSETTIER _IOW('d', 85, dk_set_tier_t)
macroDKIOCGETENCRYPTIONTYPE
#define DKIOCGETENCRYPTIONTYPE _IOR('d', 86, uint32_t)
macroDKIOCISLOWPOWERMODE
#define DKIOCISLOWPOWERMODE _IOR('d', 87, uint32_t)
macroDKIOCGETIOMINSATURATIONBYTECOUNT
#define DKIOCGETIOMINSATURATIONBYTECOUNT _IOR('d', 88, uint32_t)