Add implementation of localtime_r.

This commit is contained in:
Darren Tucker 2019-10-29 19:45:03 +11:00
parent 2046ed16c1
commit 1bcd1169c5
3 changed files with 15 additions and 0 deletions

View File

@ -1763,6 +1763,7 @@ AC_CHECK_FUNCS([ \
inet_ntop \ inet_ntop \
innetgr \ innetgr \
llabs \ llabs \
localtime_r \
login_getcapbool \ login_getcapbool \
md5_crypt \ md5_crypt \
memmem \ memmem \

View File

@ -426,3 +426,13 @@ int _ssh_compat_fflush(FILE *f)
return fflush(f); return fflush(f);
} }
#endif #endif
#ifndef HAVE_LOCALTIME_R
struct tm *
localtime_r(const time_t *timep, struct tm *result)
{
struct tm *tm = localtime(timep);
*result = *tm;
return result;
}
#endif

View File

@ -178,4 +178,8 @@ int flock(int, int);
# define fflush(x) (_ssh_compat_fflush(x)) # define fflush(x) (_ssh_compat_fflush(x))
#endif #endif
#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *, struct tm *);
#endif
#endif /* _BSD_MISC_H */ #endif /* _BSD_MISC_H */