#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
#define DK_FEATURE_BARRIER 0x00000002
#define DK_FEATURE_PRIORITY 0x00000004
#define DK_FEATURE_UNMAP 0x00000010
#define DK_SYNCHRONIZE_OPTION_BARRIER 0x00000002
size 16, align 8
| uint64_t | offset | |
| uint64_t | length | |
typedef struct dk_extent_t dk_extent_t;
typedef struct dk_firmware_path_t dk_firmware_path_t;
size 24, align 8
| uint64_t | offset | |
| uint64_t | length | |
| uint32_t | options | |
| uint8_t[4] | reserved0160 | reserved, clear to zero |
typedef struct dk_synchronize_t dk_synchronize_t;
size 16, align 8
| dk_extent_t * | extents | |
| uint32_t | extentsCount | |
| uint32_t | options | |
typedef struct dk_unmap_t dk_unmap_t;
size 64, align 8
| uint64_t | flags | |
| uint64_t | hotfile_size | in bytes |
| uint64_t | hibernate_minsize | |
| uint64_t | swapfile_pinning | |
| uint64_t[4] | padding | |
typedef struct dk_corestorage_info_t dk_corestorage_info_t;
#define DK_CORESTORAGE_ENABLE_HOTFILES 0x00000002
#define DK_CORESTORAGE_PIN_YOUR_SWAPFILE 0x00000004
#define DK_PROVISION_TYPE_MAPPED 0x00
#define DK_PROVISION_TYPE_DEALLOCATED 0x01
#define DK_PROVISION_TYPE_ANCHORED 0x02
size 24, align 8
| uint64_t | offset | |
| uint64_t | length | |
| uint8_t | provisionType | |
| uint8_t[7] | reserved | |
typedef struct dk_provision_extent_t dk_provision_extent_t;
size 40, align 8
| uint64_t | offset | input: logical byte offset |
| uint64_t | length | input: byte length, 0 for whole length |
| uint64_t | options | reserved, clear to zero |
| uint32_t | reserved | not used |
| uint32_t | extentsCount | input/output: count for extents |
| dk_provision_extent_t * | extents | output: provision extents |
typedef struct dk_provision_status_t dk_provision_status_t;
size 32, align 8
| uint64_t | options | reserved, clear to zero |
| uint64_t | reserved | reserved, clear to zero |
| uint64_t | description_size | |
| char * | description | |
typedef struct dk_error_description_t dk_error_description_t;
#define DK_LOCATION_INTERNAL 0x00000000
#define DK_LOCATION_EXTERNAL 0x00000001
#define DKIOCEJECT _IO('d', 21)#define DKIOCGETBLOCKSIZE _IOR('d', 24, uint32_t)#define DKIOCGETBLOCKCOUNT _IOR('d', 25, uint64_t)#define DKIOCISWRITABLE _IOR('d', 29, uint32_t)#define DKIOCREQUESTIDLE _IO('d', 30)#define DKIOCGETLOCATION _IOR('d', 33, uint64_t)#define DKIOCGETMAXBLOCKCOUNTREAD _IOR('d', 64, uint64_t)#define DKIOCGETMAXBLOCKCOUNTWRITE _IOR('d', 65, uint64_t)#define DKIOCGETMAXBYTECOUNTREAD _IOR('d', 70, uint64_t)#define DKIOCGETMAXBYTECOUNTWRITE _IOR('d', 71, uint64_t)#define DKIOCGETMAXSEGMENTCOUNTREAD _IOR('d', 66, uint64_t)#define DKIOCGETMAXSEGMENTCOUNTWRITE _IOR('d', 67, uint64_t)#define DKIOCGETMAXSEGMENTBYTECOUNTREAD _IOR('d', 68, uint64_t)#define DKIOCGETMAXSEGMENTBYTECOUNTWRITE _IOR('d', 69, uint64_t)#define DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT _IOR('d', 74, uint64_t)#define DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT _IOR('d', 75, uint64_t)#define DKIOCGETFEATURES _IOR('d', 76, uint32_t)#define DKIOCGETPHYSICALBLOCKSIZE _IOR('d', 77, uint32_t)#define DKIOCGETCOMMANDPOOLSIZE _IOR('d', 78, uint32_t)#define DKIOCSYNCHRONIZECACHE _IO('d', 22)