Re: Fwd: [arm-gnu] printf problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: [arm-gnu] printf problem



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