1*7b5038d7SDag-Erling Smørgrav #ifdef HAVE_CONFIG_H 2*7b5038d7SDag-Erling Smørgrav #include <ldns/config.h> 3*7b5038d7SDag-Erling Smørgrav #endif 4*7b5038d7SDag-Erling Smørgrav 5*7b5038d7SDag-Erling Smørgrav #ifdef HAVE_TIME_H 6*7b5038d7SDag-Erling Smørgrav #include <time.h> 7*7b5038d7SDag-Erling Smørgrav #endif 8*7b5038d7SDag-Erling Smørgrav ctime_r(const time_t * timep,char * buf)9*7b5038d7SDag-Erling Smørgravchar *ctime_r(const time_t *timep, char *buf) 10*7b5038d7SDag-Erling Smørgrav { 11*7b5038d7SDag-Erling Smørgrav /* no thread safety. */ 12*7b5038d7SDag-Erling Smørgrav char* result = ctime(timep); 13*7b5038d7SDag-Erling Smørgrav if(buf && result) 14*7b5038d7SDag-Erling Smørgrav strcpy(buf, result); 15*7b5038d7SDag-Erling Smørgrav return result; 16*7b5038d7SDag-Erling Smørgrav } 17