linux-sysprog · beginner · ~15 min
Recognise reentrant (_r) library variants.
Implement int is_reentrant(const char *fn) returning 1 for the thread-safe _r variants "strtok_r" and "localtime_r", and 0 for "strtok" and "localtime".
#include <string.h>
int is_reentrant(const char *fn) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.