Hello Troop,
Thank you for help.
I wanted to know if write caching enabled from C program
instead of forking sdparm and hdparm.
For scsi disks, scsi standard mentions mode sense page 0x8 gives
whether caching enabled or not. Hence I can use SG_IO ioctl for this.
For IDE, sata, pata and other possible non scsi disks, while googling
around, I found HDIO_GET_WCACHE ioctl in "/usr/include/linux/hdreg.h".
Can I use this ioctl? Is it public and defined on all linuses?
Is there any manual page for this?
The following link provides
http://www.kernel.org/doc/Documentation/ioctl/hdio.txt
documentation of above ioctls?
Thanks and Regards,
Mannu.