RTEMS pty driver

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jan 17 13:16:01 UTC 2002



Ralf Corsepius wrote:
> 
> Am Mit, 2002-01-16 um 04.16 schrieb Till Straumann:
> > Fernando.
> >
> > I had a problem with my application because
> > the stdout stream had its error flag (__SERR)
> > set on entry to my Initialization task.
> >
> > I tracked it down and found that your pty
> > driver (src/libnetworking/rtems_telnetd/pty.c)
> > redefines
> >
> > ( $Id: pty.c,v 1.1 2001/08/09 22:06:51 joel Exp $ )
> >
> > #define printk printf
> This doesn't look right, IHMO.
> 
> > However, pty_initialize() (which calls printk) ends
> > up calling printf() at driver initialization time when it
> > is not yet safe to use stdio (at least on some BSPs).
> >
> > Shouldn't the driver use the true printk() ?
> If pty_initialize is called at driver initialization time, as you say,
> then using printf there is not correct.

Ralf's correct.  It is not safe to use printf at all before the 
tasking is running.

We had to move C++ constructors to execute after tasking was initiated
for this very reason.

> May-be Fernando should comment on this. What was the rationale to use
> printf there?
> 
> Ralf

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list