Re: char driver error

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

 



OK. See how write and read works.

> $strace echo -n "abcd" > /dev/memory(/home/aravind/me
> write(1, "abcd", 4)                     = 1
> write(1, "bcd", 3)                      = 1
> write(1, "cd", 2)                       = 1
> write(1, "d", 1)                        = 1

>$ strace cat /dev/memory(/home/aravind/memory)

> read(3, "d", 32768)                     = 1
> write(1, "d", 1d)                        = 1

Please allocate space for more than 1 char, and also
correct memory_write

  tmp=buf+count-1; -> tmp=buf+*f_ps-1;

thanks,
Daniel.

_______________________________________________
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