Re: char driver module prob.

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

 



On Tue, Mar 29, 2005 at 05:09:39PM +0530, Mandeep Sandhu wrote:
> On Tue, 2005-03-29 at 13:07 +0200, Erik Mouw wrote:
> > No, userland doesn't expect it, and it will confuse your terminal.
> > printf() used in userland programs also doesn't print a \0 after every
> > line, and with reason: \0 is *only* the string terminator used
> > internally in C, *not* a way to signal end-of-file to userland.
> > 
> ok folks! i tried strlen too......but to no avail! :(
> still only putting `\n' does the trick! what say Erik?

Without \n, your shell probably overwrites whatever is printed by cat
with the shell prompt. However, strace shows that cat indeed prints the
string, so nothing is wrong with either your device or the cat program.
Try 'cat /dev/mydevice | more' to see it is printed indeed.


Erik

-- 
Erik Mouw
J.A.K.Mouw@xxxxxxxxxxxxxx  mouw@xxxxxxxxxxxx

Attachment: signature.asc
Description: Digital signature


[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