---
title: getWriteCacheState
framework: kernel
role: pseudoSymbol
path: kernel/ioblockstoragedevice/1811731-getwritecachestate
---

# getWriteCacheState

Reports the current write cache state of the device.

## Declaration

```occ
#ifdef __LP64__
 virtual IOReturn getWriteCacheState(
 bool *enabled) = 0; 
#else /* !__LP64__ */
virtual IOReturn getWriteCacheState(
 bool *enabled); 
#endif 
/* !__LP64__ */
```

## Parameters

- `enabled`: Pointer to returned result. True indicates the write cache is enabled; False indicates the write cache is disabled.

## Overview

Overview Reports the current write cache state of the device. The write cache state is not guaranteed to persist across reboots and detaches.

## See Also

### Miscellaneous

- [doAsyncReadWrite](kernel/ioblockstoragedevice/1811665-doasyncreadwrite.md)
- [doEjectMedia](kernel/ioblockstoragedevice/1811672-doejectmedia.md)
- [doFormatMedia](kernel/ioblockstoragedevice/1811680-doformatmedia.md)
- [doGetFormatCapacities](kernel/ioblockstoragedevice/1811684-dogetformatcapacities.md)
- [doSynchronizeCache](kernel/ioblockstoragedevice/1811691-dosynchronizecache.md)
- [doUnmap](kernel/ioblockstoragedevice/1811698-dounmap.md)
- [getAdditionalDeviceInfoString](kernel/ioblockstoragedevice/1811705-getadditionaldeviceinfostring.md)
- [getProductString](kernel/ioblockstoragedevice/1811712-getproductstring.md)
- [getRevisionString](kernel/ioblockstoragedevice/1811717-getrevisionstring.md)
- [getVendorString](kernel/ioblockstoragedevice/1811724-getvendorstring.md)
- [init](kernel/ioblockstoragedevice/1811746-init.md)
- [reportBlockSize](kernel/ioblockstoragedevice/1811753-reportblocksize.md)
- [reportEjectability](kernel/ioblockstoragedevice/1811761-reportejectability.md)
- [reportMaxValidBlock](kernel/ioblockstoragedevice/1811771-reportmaxvalidblock.md)
- [reportMediaState](kernel/ioblockstoragedevice/1811780-reportmediastate.md)
- [reportRemovability](kernel/ioblockstoragedevice/1811787-reportremovability.md)
- [reportWriteProtection](kernel/ioblockstoragedevice/1811796-reportwriteprotection.md)
- [requestIdle](kernel/ioblockstoragedevice/1811804-requestidle.md)
- [setWriteCacheState](kernel/ioblockstoragedevice/1811812-setwritecachestate.md)
