Hi Sri,

On Thu, Sep 23, 2010 at 11:12 PM, sri <bskmo...@gmail.com> wrote:
> Hi
>
> printk("device opened\n");
> printk("device file opened by %d", current->pid);
>
> Here the second printk output is not displayed.
> Without \n printk is not flushing out its buffer.  If I give, \n in the
> second printk it is working.
>
> Is there any reason for that?

I think that the only reason is to try and ensure that as much of the
message stays together as possible.

This is especially true when the printk's are going to a serial
console. The code has to parse for the \n's anyways since it looks for
the <x> tags (where x is a number - see KERN_ERR etc) at the beginning
of each line (i.e. immediately after the \n)

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to