Re: f_pos passing as a fouth argument in read and write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/12/06, Deepak Joshi <deepak_cins@xxxxxxxxxxx> wrote:
Hi all,

While reading device drivers by rubini, i  found following statement related
to loff_t fops.

The current reading or writing position. loff_t is a 64-bit value (long long
in gcc terminology). The driver can read this value if it needs to know the
current position in the file, but should never change it (read and write
should update a position using the pointer they receive as the last argument
instead of acting on filp->f_pos directly).

so why can't we update the position directly by using filp->f_pos structure.

Thanks in advance,
Deepak Joshi.


To modify the position of the file pointer, you have to use the seek stuff.

--
What this world needs is a good five-dollar plasma weapon.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux