Re: Fwd: [arm-gnu] printf problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: [arm-gnu] printf problem
- To: ravi <ravishankar.rangam@xxxxxxxxx>
- Subject: Re: Fwd: [arm-gnu] printf problem
- From: Carlos O'Donell <carlos@xxxxxxxxxxxxxxxx>
- Date: Fri, 14 Mar 2008 10:39:25 -0400
ravi wrote:
__write()
{
return 0;
}
When I ran my program, it is hung inside the sprintf().
The documentation for __write says it returns the number of bytes
processed. Your stub for __write returns "0", which means "Zero bytes
were processed." This causes sprintf to loop forever trying to process
the bytes.
Try this stub instead:
__write (int fd, const void *buf, int count)
{
/* Tell the C library we processed *all* the bytes. */
return count;
}
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@xxxxxxxxxxxxxxxx
(650) 331-3385 x716