Richard said:
He wishes to use it from C therefore it is totally on topic
since calling such functions is indeed a function of C and
catered for in the standard.
Unh, the OP wants to know if stat is thread safe. Threads and
their safe use are complete outside the scope of C, so it's
totally offtopic here.
Some people might argue, that parts of the C standard library,
like errno, are thread unsafe. However those people are ignorant
about thread local storage, and that the errno variable can be
linked as thread local and then is thread safe. So from the pure
language point of view that question cannot be answered, since
it largely interacts with parts outside the scope of any
language (linkage, runtime memory allocation flags or setting
memory thread local, mutex or semaphore locking implemented in
the used functions)
At least once can say, that the interface of stat allows for
thread safety, but if it is so is implementation dependent.
Wolfgang Draxinger