Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added more functions with data races to the list.

...

According to the C Standard, the following library functions are not required to avoid data races:

  • rand(), srand()
  • getenv()
  • strtok()
  • strerror()
  • asctime(), ctime(), localtime()
  • setlocale()
  • ATOMIC_VAR_INIT, atomic_init()
  • tmpnam()ctime() when called with a null pointer argument
  • mbrtoc16(), c16rtomb(), mbrtoc32(), c32rtomb() when called with a null mbstate_t *

Section 2.9.1 of the System Interfaces volume of POSIX.1-2008 has a much longer list of functions that are not required to be thread-safe.

...