extern time_t mktime __P ((struct tm * __tp));
extern double difftime __P ((time_t *__time2, time_t *__time1));
-extern time_t *gtime(time_t *tvec);
extern void __tm_conv __P((struct tm *tmbuf, time_t *t, int offset));
-extern void __asctime __P((char *, struct tm *));
extern char *asctime __P ((struct tm * __tp));
+extern char *asctime_r __P((struct tm *, char * __buf));
extern char *ctime __P ((time_t * __tp));
+extern char *ctime_r __P ((time_t * __tp, char * __buf));
extern void tzset __P ((void));
extern struct tm *gmtime __P ((time_t *__tp));
extern struct tm *localtime __P ((time_t * __tp));
-extern unsigned long convtime __P ((time_t *time_field));
+extern struct tm *gmtime_r(time_t *tvec, struct tm *result);
+extern struct tm *localtime_r(time_t *tvec, struct tm *result);
typedef int clockid_t;
SRC_C += fsetpos.c ftell.c fwrite.c getcwd.c
SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getopt.c
SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c
-SRC_C += gmtime.c grent.c index.c isatty.c itoa.c killpg.c
-SRC_C += localtim.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c malloc.c
-SRC_C += mkfifo.c nanosleep.c opendir.c pause.c perror.c
+SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c itoa.c killpg.c
+SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c
+SRC_C += malloc.c mkfifo.c nanosleep.c opendir.c pause.c perror.c
SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c
SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c
SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c
static char days[] = "SunMonTueWedThuFriSat";
static char mons[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
-void __asctime(char *buffer, struct tm *ptm)
+char *asctime_r(struct tm *ptm, char *buffer)
{
int year;
hit(buffer + 21, year / 100);
hit(buffer + 22, year / 10);
hit(buffer + 23, year);
+ return buffer;
}
/* asctime - convert date and time to ascii.
if (timeptr == 0)
return 0;
- __asctime(timebuf, timeptr);
- return timebuf;
+ return asctime_r(timeptr, timebuf);
}
--- /dev/null
+/*************************** CTIME ************************************/ \r
+ \r
+#include <time.h>\r
+#include <string.h>\r
+\r
+char *ctime_r(time_t * timep, char *buf) \r
+{\r
+ struct tm tmtmp;
+ return asctime_r(localtime_r(timep, &tmtmp), buf);
+}
--- /dev/null
+/*************************** GMTIME ************************************/
+
+#include <time.h>
+#include <string.h>
+
+struct tm *gmtime_r(time_t *timep, struct tm *result)
+{
+ __tm_conv(result, timep, (int) (timezone / 60));
+ return result;
+}
--- /dev/null
+#include <time.h>
+#include <string.h>
+
+struct tm *localtime_r(time_t * timep, struct tm *result)
+{
+ __tm_conv(result, timep, 0);
+ return result;
+}