Re: Simple Misc Driver - Problem with string copy to user

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

 



Hi!

On Die, 2014-05-27 at 10:09 -0300, Lucas Tanure wrote:
> Wow, many thanks.
> So the read operation should return the total number of bytes, not a
> true/false int.

The syscall here (done by `head`) is read() ...

> I need to read more about this operations.

.. and the drivers .read function is called if the user-space calls
read() on the (opened) device.
This .read function returns
*) > 0 with the number of successfully read bytes
*) == 0 on end-of-file.
*) < 0 on errors. And these error codes are found on `man errno` and
   one just returns them as "-Exxxx".

[ Fullquote deleted ]

Kind regards,
	Bernd


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[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