EmbLogic's Blog

Algo for Write operation

* Define Local Device.

*Fetch device from local device.

*Allocate space for buffer,pointed to by dev->data.

*Check for error ,clear the allocated space using memset.

*Check if the fpos is beyond the device size.

*Check for errors.

*Check if the sufficient amount of space is available to write the count no of bytes.

** if not modify the count accordingly.

*Copy from user.

*Modify the file position.

*Identify the no. of bytes yet to be written.

*Modify the device data size.

*Return space for buffer,pointed to by dev->data.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>