The output for this code printed out ‘Success’.
printf(\"%m\\n\");
Actually, the manual of printf() concerning %m is quite laconic:
m (Glibc extension; supported by uClibc and musl.) Print output
of strerror(errno). No argument is required.
But strerror() has a problem in multi-threaded programs: it is not reentrant. The thread-safe version is strerror_r().
A little study of the GLIBC implementation shows that %m is actually equivalent to strerror_r(). Hence %m is thread-safe!