#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
41 macros · 10 structs · 10 typedefs

macroDK_FEATURE_BARRIER

#define DK_FEATURE_BARRIER 0x00000002

macroDK_FEATURE_PRIORITY

#define DK_FEATURE_PRIORITY 0x00000004

macroDK_FEATURE_UNMAP

#define DK_FEATURE_UNMAP 0x00000010

macroDK_SYNCHRONIZE_OPTION_BARRIER

#define DK_SYNCHRONIZE_OPTION_BARRIER 0x00000002

structdk_extent_t

size 16, align 8
uint64_toffset
uint64_tlength

typedefdk_extent_t

typedef struct dk_extent_t dk_extent_t;

structdk_firmware_path_t

size 128, align 1
char[128]path

typedefdk_firmware_path_t

typedef struct dk_firmware_path_t dk_firmware_path_t;

structdk_format_capacity_t

size 16, align 8
uint64_tblockCount
uint32_tblockSize
uint8_t[4]reserved0096reserved, clear to zero

typedefdk_format_capacity_t

typedef struct dk_format_capacity_t dk_format_capacity_t;

structdk_format_capacities_t

size 16, align 8
dk_format_capacity_t *capacities
uint32_tcapacitiesCountuse zero to probe count
uint8_t[4]reserved0096reserved, clear to zero

typedefdk_format_capacities_t

typedef struct dk_format_capacities_t dk_format_capacities_t;

structdk_synchronize_t

size 24, align 8
uint64_toffset
uint64_tlength
uint32_toptions
uint8_t[4]reserved0160reserved, clear to zero

typedefdk_synchronize_t

typedef struct dk_synchronize_t dk_synchronize_t;

structdk_unmap_t

size 16, align 8
dk_extent_t *extents
uint32_textentsCount
uint32_toptions

typedefdk_unmap_t

typedef struct dk_unmap_t dk_unmap_t;

structdk_corestorage_info_t

size 64, align 8
uint64_tflags
uint64_thotfile_sizein bytes
uint64_thibernate_minsize
uint64_tswapfile_pinning
uint64_t[4]padding

typedefdk_corestorage_info_t

typedef struct dk_corestorage_info_t dk_corestorage_info_t;

macroDK_CORESTORAGE_PIN_YOUR_METADATA

#define DK_CORESTORAGE_PIN_YOUR_METADATA 0x00000001

macroDK_CORESTORAGE_ENABLE_HOTFILES

#define DK_CORESTORAGE_ENABLE_HOTFILES 0x00000002

macroDK_CORESTORAGE_PIN_YOUR_SWAPFILE

#define DK_CORESTORAGE_PIN_YOUR_SWAPFILE 0x00000004

macroDK_PROVISION_TYPE_MAPPED

#define DK_PROVISION_TYPE_MAPPED 0x00

macroDK_PROVISION_TYPE_DEALLOCATED

#define DK_PROVISION_TYPE_DEALLOCATED 0x01

macroDK_PROVISION_TYPE_ANCHORED

#define DK_PROVISION_TYPE_ANCHORED 0x02

structdk_provision_extent_t

size 24, align 8
uint64_toffset
uint64_tlength
uint8_tprovisionType
uint8_t[7]reserved

typedefdk_provision_extent_t

typedef struct dk_provision_extent_t dk_provision_extent_t;

structdk_provision_status_t

size 40, align 8
uint64_toffsetinput: logical byte offset
uint64_tlengthinput: byte length, 0 for whole length
uint64_toptionsreserved, clear to zero
uint32_treservednot used
uint32_textentsCountinput/output: count for extents
dk_provision_extent_t *extentsoutput: provision extents

typedefdk_provision_status_t

typedef struct dk_provision_status_t dk_provision_status_t;

structdk_error_description_t

size 32, align 8
uint64_toptionsreserved, clear to zero
uint64_treservedreserved, clear to zero
uint64_tdescription_size
char *description

typedefdk_error_description_t

typedef struct dk_error_description_t dk_error_description_t;

macroDK_LOCATION_INTERNAL

#define DK_LOCATION_INTERNAL 0x00000000

macroDK_LOCATION_EXTERNAL

#define DK_LOCATION_EXTERNAL 0x00000001

macroDKIOCEJECT

#define DKIOCEJECT _IO('d', 21)

macroDKIOCSYNCHRONIZE

#define DKIOCSYNCHRONIZE _IOW('d', 22, dk_synchronize_t)

macroDKIOCFORMAT

#define DKIOCFORMAT _IOW('d', 26, dk_format_capacity_t)

macroDKIOCGETFORMATCAPACITIES

#define DKIOCGETFORMATCAPACITIES _IOWR('d', 26, dk_format_capacities_t)

macroDKIOCGETBLOCKSIZE

#define DKIOCGETBLOCKSIZE _IOR('d', 24, uint32_t)

macroDKIOCGETBLOCKCOUNT

#define DKIOCGETBLOCKCOUNT _IOR('d', 25, uint64_t)

macroDKIOCGETFIRMWAREPATH

#define DKIOCGETFIRMWAREPATH _IOR('d', 28, dk_firmware_path_t)

macroDKIOCISFORMATTED

#define DKIOCISFORMATTED _IOR('d', 23, uint32_t)

macroDKIOCISWRITABLE

#define DKIOCISWRITABLE _IOR('d', 29, uint32_t)

macroDKIOCREQUESTIDLE

#define DKIOCREQUESTIDLE _IO('d', 30)

macroDKIOCUNMAP

#define DKIOCUNMAP _IOW('d', 31, dk_unmap_t)

macroDKIOCCORESTORAGE

#define DKIOCCORESTORAGE _IOR('d', 32, dk_corestorage_info_t)

macroDKIOCGETLOCATION

#define DKIOCGETLOCATION _IOR('d', 33, uint64_t)

macroDKIOCGETMAXBLOCKCOUNTREAD

#define DKIOCGETMAXBLOCKCOUNTREAD _IOR('d', 64, uint64_t)

macroDKIOCGETMAXBLOCKCOUNTWRITE

#define DKIOCGETMAXBLOCKCOUNTWRITE _IOR('d', 65, uint64_t)

macroDKIOCGETMAXBYTECOUNTREAD

#define DKIOCGETMAXBYTECOUNTREAD _IOR('d', 70, uint64_t)

macroDKIOCGETMAXBYTECOUNTWRITE

#define DKIOCGETMAXBYTECOUNTWRITE _IOR('d', 71, uint64_t)

macroDKIOCGETMAXSEGMENTCOUNTREAD

#define DKIOCGETMAXSEGMENTCOUNTREAD _IOR('d', 66, uint64_t)

macroDKIOCGETMAXSEGMENTCOUNTWRITE

#define DKIOCGETMAXSEGMENTCOUNTWRITE _IOR('d', 67, uint64_t)

macroDKIOCGETMAXSEGMENTBYTECOUNTREAD

#define DKIOCGETMAXSEGMENTBYTECOUNTREAD _IOR('d', 68, uint64_t)

macroDKIOCGETMAXSEGMENTBYTECOUNTWRITE

#define DKIOCGETMAXSEGMENTBYTECOUNTWRITE _IOR('d', 69, uint64_t)

macroDKIOCGETMINSEGMENTALIGNMENTBYTECOUNT

#define DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT _IOR('d', 74, uint64_t)

macroDKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT

#define DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT _IOR('d', 75, uint64_t)

macroDKIOCGETFEATURES

#define DKIOCGETFEATURES _IOR('d', 76, uint32_t)

macroDKIOCGETPHYSICALBLOCKSIZE

#define DKIOCGETPHYSICALBLOCKSIZE _IOR('d', 77, uint32_t)

macroDKIOCGETCOMMANDPOOLSIZE

#define DKIOCGETCOMMANDPOOLSIZE _IOR('d', 78, uint32_t)

macroDKIOCGETPROVISIONSTATUS

#define DKIOCGETPROVISIONSTATUS _IOWR('d', 79, dk_provision_status_t)

macroDKIOCGETERRORDESCRIPTION

#define DKIOCGETERRORDESCRIPTION _IOR('d', 80, dk_error_description_t)

macroDKIOCSYNCHRONIZECACHE

#define DKIOCSYNCHRONIZECACHE _IO('d', 22)