The ISO C library has configuration options that control thread safety, i.e. working behavior if multiple threads call the same function at the same time.
The following functionality has to be configured correctly, or used carefully in a multi-threaded environment:
printf()(and all standard I/O functions except for
date and time settings
In some cases, to make eCos development
easier, functions are provided (as specified by POSIX 1003.1) that define
re-entrant alternatives, i.e.
localtime_r(). In other cases,
configuration options are provided that control either locking of functions
or their shared data, such as with standard I/O streams,
or by using per-thread data, such as with the
In some other cases, like the setting of date and time, no re-entrant or thread-safe alternative or configuration is provided as it is simply not a worthwhile addition (date and time should rarely need to be set.)