write fop

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

 



Hi,

I've coded linux device driver for my hw device and I was wondering what is prefered return value for write function if user invokes it as:

	write(fd, buf, 0);

Note the 0 count. Currently I'm checking count and I'm returning 0 from the write operation in case count == 0. What happens is that first write successfully returns (no data), but subsequent calls to write block in the write function!?
I've tried returning -EINVAL but ended up with the same results.

Any suggestions?

regards,
hinko

--
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