Re: copy_to_user() and copy_from_user(): confusing code

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

 





On Sat, Sep 25, 2010 at 11:06 PM, Chetan Nanda <chetannanda@xxxxxxxxx> wrote:



 
as per my understanding (may be wrong), issue is not with the copy_to/from_user. May be with the return values from  bond_read/write function.
Drivers read/write should return the number of bytes read or written.
Agreed that was a mistake in my code.

On Sat, Sep 25, 2010 at 7:34 PM, Bond <jamesbond.2k.g@xxxxxxxxx> wrote: 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2a2f03b000
write(1, "abcde", 5)                    = 1
write(1, "bcde", 4)                     = 1
write(1, "cde", 3)                      = 1
write(1, "de", 2)                       = 1
write(1, "e", 1)                        = 1
close(1)                                = 0
munmap(0x7f2a2f03b000, 4096)            = 0
close(2)                                = 0
exit_group(0)                           = ?


Can you say any thing about the strace log above as why did I got the above output. 

[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