diff --git a/src/kernel/libroot/posix/time/Jamfile b/src/kernel/libroot/posix/time/Jamfile index ecb4071e4e..fe9c17c37d 100644 --- a/src/kernel/libroot/posix/time/Jamfile +++ b/src/kernel/libroot/posix/time/Jamfile @@ -1,12 +1,13 @@ SubDir OBOS_TOP src kernel libroot posix time ; # for localtime.c strftime.c -SubDirCcFlags -DNOID -DTZDIR='\"/etc/timezones\"' -DUSG_COMPAT -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED=1 -DPCTS=1 ; +SubDirCcFlags -DNOID -DTZDIR='\"/etc/timezones\"' -DUSG_COMPAT -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DPCTS=1 ; UsePrivateHeaders [ FDirName libroot time ] ; KernelMergeObject posix_time.o : asctime.c + ctime.c difftime.c localtime.c stime.c @@ -77,4 +78,4 @@ KernelMergeObject posix_time.o : # out by the National Institute of Standards and Technology # which claims to test C and Posix conformance. If you want to pass PCTS, add # -DPCTS -# to the end of the "CFLAGS=" line. \ No newline at end of file +# to the end of the "CFLAGS=" line. diff --git a/src/kernel/libroot/posix/time/ctime.c b/src/kernel/libroot/posix/time/ctime.c new file mode 100644 index 0000000000..5542e9256d --- /dev/null +++ b/src/kernel/libroot/posix/time/ctime.c @@ -0,0 +1,23 @@ +/* + * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include + + +char * +ctime(const time_t *_timer) +{ + return asctime(localtime(_timer)); +} + + +char * +ctime_r(const time_t *_timer, char *buf) +{ + struct tm tm; + return asctime_r(localtime_r(_timer, &tm), buf); +} + diff --git a/src/kernel/libroot/posix/time/localtime.c b/src/kernel/libroot/posix/time/localtime.c index 8cdcd802ec..b16a24f277 100644 --- a/src/kernel/libroot/posix/time/localtime.c +++ b/src/kernel/libroot/posix/time/localtime.c @@ -1243,28 +1243,6 @@ register struct tm * const tmp; #endif /* defined TM_GMTOFF */ } -char * -ctime(timep) -const time_t * const timep; -{ -/* -** Section 4.12.3.2 of X3.159-1989 requires that -** The ctime function converts the calendar time pointed to by timer -** to local time in the form of a string. It is equivalent to -** asctime(localtime(timer)) -*/ - return asctime(localtime(timep)); -} - -char * -ctime_r(timep, buf) -const time_t * const timep; -char * buf; -{ - struct tm tm; - - return asctime_r(localtime_r(timep, &tm), buf); -} /* ** Adapted from code provided by Robert Elz, who writes: @@ -1617,7 +1595,9 @@ struct tm * const tmp; return time1(tmp, localsub, 0L); } -#ifdef STD_INSPIRED +#ifndef STD_INSPIRED +#pragma weak timelocal=mktime +#else time_t timelocal(tmp)