xref: /onnv-gate/usr/src/head/time.h (revision 3383:f7dba0db8250)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*3383Sdamico  * Common Development and Distribution License (the "License").
6*3383Sdamico  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
220Sstevel@tonic-gate /*	  All Rights Reserved  	*/
230Sstevel@tonic-gate 
240Sstevel@tonic-gate 
250Sstevel@tonic-gate /*
26*3383Sdamico  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
270Sstevel@tonic-gate  * Use is subject to license terms.
280Sstevel@tonic-gate  */
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef _TIME_H
310Sstevel@tonic-gate #define	_TIME_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.18 */
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #include <sys/feature_tests.h>
360Sstevel@tonic-gate #include <iso/time_iso.h>
370Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
380Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
390Sstevel@tonic-gate #include <sys/types.h>
400Sstevel@tonic-gate #include <sys/time_impl.h>
410Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) ... */
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
440Sstevel@tonic-gate  * Allow global visibility for symbols defined in
450Sstevel@tonic-gate  * C++ "std" namespace in <iso/time_iso.h>.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate #if __cplusplus >= 199711L
480Sstevel@tonic-gate using std::size_t;
490Sstevel@tonic-gate using std::clock_t;
500Sstevel@tonic-gate using std::time_t;
510Sstevel@tonic-gate using std::tm;
520Sstevel@tonic-gate using std::asctime;
530Sstevel@tonic-gate using std::clock;
540Sstevel@tonic-gate using std::ctime;
550Sstevel@tonic-gate using std::difftime;
560Sstevel@tonic-gate using std::gmtime;
570Sstevel@tonic-gate using std::localtime;
580Sstevel@tonic-gate using std::mktime;
590Sstevel@tonic-gate using std::time;
600Sstevel@tonic-gate using std::strftime;
610Sstevel@tonic-gate #endif
620Sstevel@tonic-gate 
630Sstevel@tonic-gate #ifdef	__cplusplus
640Sstevel@tonic-gate extern "C" {
650Sstevel@tonic-gate #endif
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #ifndef _CLOCKID_T
680Sstevel@tonic-gate #define	_CLOCKID_T
690Sstevel@tonic-gate typedef int	clockid_t;
700Sstevel@tonic-gate #endif
710Sstevel@tonic-gate 
720Sstevel@tonic-gate #ifndef _TIMER_T
730Sstevel@tonic-gate #define	_TIMER_T
740Sstevel@tonic-gate typedef int	timer_t;
750Sstevel@tonic-gate #endif
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #if defined(__STDC__)
780Sstevel@tonic-gate 
790Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
800Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
810Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
820Sstevel@tonic-gate extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD,
830Sstevel@tonic-gate 			struct tm *_RESTRICT_KYWD);
840Sstevel@tonic-gate extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD,
850Sstevel@tonic-gate 			struct tm *_RESTRICT_KYWD);
860Sstevel@tonic-gate #endif
870Sstevel@tonic-gate 
880Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
890Sstevel@tonic-gate 	defined(_XPG4) || defined(__EXTENSIONS__)
900Sstevel@tonic-gate 
910Sstevel@tonic-gate #ifdef _STRPTIME_DONTZERO
920Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
930Sstevel@tonic-gate #pragma	redefine_extname strptime __strptime_dontzero
940Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
950Sstevel@tonic-gate extern char *__strptime_dontzero(const char *, const char *, struct tm *);
960Sstevel@tonic-gate #define	strptime	__strptime_dontzero
970Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
980Sstevel@tonic-gate #endif	/* _STRPTIME_DONTZERO */
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate extern char *strptime(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
1010Sstevel@tonic-gate 		struct tm *_RESTRICT_KYWD);
1020Sstevel@tonic-gate 
1030Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
1040Sstevel@tonic-gate 
1050Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1060Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
1070Sstevel@tonic-gate /*
1080Sstevel@tonic-gate  * Neither X/Open nor POSIX allow the inclusion of <signal.h> for the
1090Sstevel@tonic-gate  * definition of the sigevent structure.  Both require the inclusion
1100Sstevel@tonic-gate  * of <signal.h> and <time.h> when using the timer_create() function.
1110Sstevel@tonic-gate  * However, X/Open also specifies that the sigevent structure be defined
1120Sstevel@tonic-gate  * in <time.h> as described in the header <signal.h>.  This prevents
1130Sstevel@tonic-gate  * compiler warnings for applications that only include <time.h> and not
1140Sstevel@tonic-gate  * also <signal.h>.  The sigval union and the sigevent structure is
1150Sstevel@tonic-gate  * therefore defined both here and in <sys/siginfo.h> which gets included
1160Sstevel@tonic-gate  * via inclusion of <signal.h>.
1170Sstevel@tonic-gate  */
1180Sstevel@tonic-gate #ifndef	_SIGVAL
1190Sstevel@tonic-gate #define	_SIGVAL
1200Sstevel@tonic-gate union sigval {
1210Sstevel@tonic-gate 	int	sival_int;	/* integer value */
1220Sstevel@tonic-gate 	void	*sival_ptr;	/* pointer value */
1230Sstevel@tonic-gate };
1240Sstevel@tonic-gate #endif	/* _SIGVAL */
1250Sstevel@tonic-gate 
1260Sstevel@tonic-gate #ifndef	_SIGEVENT
1270Sstevel@tonic-gate #define	_SIGEVENT
1280Sstevel@tonic-gate struct sigevent {
1290Sstevel@tonic-gate 	int		sigev_notify;	/* notification mode */
1300Sstevel@tonic-gate 	int		sigev_signo;	/* signal number */
1310Sstevel@tonic-gate 	union sigval	sigev_value;	/* signal value */
1320Sstevel@tonic-gate 	void		(*sigev_notify_function)(union sigval);
1330Sstevel@tonic-gate 	pthread_attr_t	*sigev_notify_attributes;
1340Sstevel@tonic-gate 	int		__sigev_pad2;
1350Sstevel@tonic-gate };
1360Sstevel@tonic-gate #endif	/* _SIGEVENT */
1370Sstevel@tonic-gate 
1380Sstevel@tonic-gate extern int clock_getres(clockid_t, struct timespec *);
1390Sstevel@tonic-gate extern int clock_gettime(clockid_t, struct timespec *);
1400Sstevel@tonic-gate extern int clock_settime(clockid_t, const struct timespec *);
1410Sstevel@tonic-gate extern int timer_create(clockid_t, struct sigevent *_RESTRICT_KYWD,
1420Sstevel@tonic-gate 		timer_t *_RESTRICT_KYWD);
1430Sstevel@tonic-gate extern int timer_delete(timer_t);
1440Sstevel@tonic-gate extern int timer_getoverrun(timer_t);
1450Sstevel@tonic-gate extern int timer_gettime(timer_t, struct itimerspec *);
1460Sstevel@tonic-gate extern int timer_settime(timer_t, int, const struct itimerspec *_RESTRICT_KYWD,
1470Sstevel@tonic-gate 		struct itimerspec *_RESTRICT_KYWD);
1480Sstevel@tonic-gate 
1490Sstevel@tonic-gate extern int nanosleep(const struct timespec *, struct timespec *);
1500Sstevel@tonic-gate extern int clock_nanosleep(clockid_t, int,
1510Sstevel@tonic-gate 	const struct timespec *, struct timespec *);
1520Sstevel@tonic-gate 
1530Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
1540Sstevel@tonic-gate 
1550Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX) || \
1560Sstevel@tonic-gate 	defined(__EXTENSIONS__)
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate extern void tzset(void);
1590Sstevel@tonic-gate extern char *tzname[2];
1600Sstevel@tonic-gate 
1610Sstevel@tonic-gate /* CLK_TCK marked as LEGACY in SUSv2 and removed in SUSv3 */
1620Sstevel@tonic-gate #if !defined(_XPG6) || defined(__EXTENSIONS__)
1630Sstevel@tonic-gate #ifndef CLK_TCK
1640Sstevel@tonic-gate extern long _sysconf(int);	/* System Private interface to sysconf() */
1650Sstevel@tonic-gate #define	CLK_TCK	((clock_t)_sysconf(3))	/* clock ticks per second */
1660Sstevel@tonic-gate 				/* 3 is _SC_CLK_TCK */
1670Sstevel@tonic-gate #endif
1680Sstevel@tonic-gate #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1710Sstevel@tonic-gate 	defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1720Sstevel@tonic-gate extern long timezone;
1730Sstevel@tonic-gate extern int daylight;
1740Sstevel@tonic-gate #endif
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)... */
1770Sstevel@tonic-gate 
178*3383Sdamico #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
179*3383Sdamico 	defined(__EXTENSIONS__)
1800Sstevel@tonic-gate extern int cftime(char *, char *, const time_t *);
1810Sstevel@tonic-gate extern int ascftime(char *, const char *, const struct tm *);
1820Sstevel@tonic-gate extern long altzone;
1830Sstevel@tonic-gate #endif
1840Sstevel@tonic-gate 
1850Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1860Sstevel@tonic-gate 	defined(_XPG4_2) || defined(__EXTENSIONS__)
1870Sstevel@tonic-gate extern struct tm *getdate(const char *);
1880Sstevel@tonic-gate #ifdef	_REENTRANT
1890Sstevel@tonic-gate #undef getdate_err
1900Sstevel@tonic-gate #define	getdate_err *(int *)_getdate_err_addr()
1910Sstevel@tonic-gate extern int *_getdate_err_addr(void);
1920Sstevel@tonic-gate #else
1930Sstevel@tonic-gate extern int getdate_err;
1940Sstevel@tonic-gate #endif /* _REENTRANT */
1950Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
1960Sstevel@tonic-gate 
1970Sstevel@tonic-gate #else /* __STDC__ */
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate extern int cftime(), ascftime();
2000Sstevel@tonic-gate extern void tzset();
2010Sstevel@tonic-gate 
2020Sstevel@tonic-gate #ifdef _STRPTIME_DONTZERO
2030Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
2040Sstevel@tonic-gate #pragma	redefine_extname strptime	__strptime_dontzero
2050Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
2060Sstevel@tonic-gate extern char *__strptime_dontzero();
2070Sstevel@tonic-gate #define	strptime	__strptime_dontzero
2080Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
2090Sstevel@tonic-gate #endif	/* _STRPTIME_DONTZERO */
2100Sstevel@tonic-gate 
2110Sstevel@tonic-gate extern char *strptime();
2120Sstevel@tonic-gate 
2130Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
2140Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2150Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
2160Sstevel@tonic-gate extern struct tm *gmtime_r();
2170Sstevel@tonic-gate extern struct tm *localtime_r();
2180Sstevel@tonic-gate #endif
2190Sstevel@tonic-gate 
2200Sstevel@tonic-gate extern long timezone, altzone;
2210Sstevel@tonic-gate extern int daylight;
2220Sstevel@tonic-gate extern char *tzname[2];
2230Sstevel@tonic-gate 
2240Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
2250Sstevel@tonic-gate extern struct tm *getdate();
2260Sstevel@tonic-gate #ifdef	_REENTRANT
2270Sstevel@tonic-gate #undef getdate_err
2280Sstevel@tonic-gate #define	getdate_err *(int *)_getdate_err_addr()
2290Sstevel@tonic-gate extern int *_getdate_err_addr();
2300Sstevel@tonic-gate #else
2310Sstevel@tonic-gate extern int getdate_err;
2320Sstevel@tonic-gate #endif /* _REENTRANT */
2330Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
2340Sstevel@tonic-gate 
2350Sstevel@tonic-gate #endif	/* __STDC__ */
2360Sstevel@tonic-gate 
2370Sstevel@tonic-gate /*
2380Sstevel@tonic-gate  * ctime_r() & asctime_r() prototypes are defined here.
2390Sstevel@tonic-gate  */
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate /*
2420Sstevel@tonic-gate  * Previous releases of Solaris, starting at 2.3, provided definitions of
2430Sstevel@tonic-gate  * various functions as specified in POSIX.1c, Draft 6.  For some of these
2440Sstevel@tonic-gate  * functions, the final POSIX 1003.1c standard had a different number of
2450Sstevel@tonic-gate  * arguments and return values.
2460Sstevel@tonic-gate  *
2470Sstevel@tonic-gate  * The following segment of this header provides support for the standard
2480Sstevel@tonic-gate  * interfaces while supporting applications written under earlier
2490Sstevel@tonic-gate  * releases.  The application defines appropriate values of the feature
2500Sstevel@tonic-gate  * test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate
2510Sstevel@tonic-gate  * whether it was written to expect the Draft 6 or standard versions of
2520Sstevel@tonic-gate  * these interfaces, before including this header.  This header then
2530Sstevel@tonic-gate  * provides a mapping from the source version of the interface to an
2540Sstevel@tonic-gate  * appropriate binary interface.  Such mappings permit an application
2550Sstevel@tonic-gate  * to be built from libraries and objects which have mixed expectations
2560Sstevel@tonic-gate  * of the definitions of these functions.
2570Sstevel@tonic-gate  *
2580Sstevel@tonic-gate  * For applications using the Draft 6 definitions, the binary symbol is the
2590Sstevel@tonic-gate  * same as the source symbol, and no explicit mapping is needed.  For the
2600Sstevel@tonic-gate  * standard interface, the function func() is mapped to the binary symbol
2610Sstevel@tonic-gate  * _posix_func().  The preferred mechanism for the remapping is a compiler
2620Sstevel@tonic-gate  * #pragma.  If the compiler does not provide such a #pragma, the header file
2630Sstevel@tonic-gate  * defines a static function func() which calls the _posix_func() version;
2640Sstevel@tonic-gate  * this has to be done instead of #define since POSIX specifies that an
2650Sstevel@tonic-gate  * application can #undef the symbol and still be bound to the correct
2660Sstevel@tonic-gate  * implementation.  Unfortunately, the statics confuse lint so we fallback to
2670Sstevel@tonic-gate  * #define in that case.
2680Sstevel@tonic-gate  *
2690Sstevel@tonic-gate  * NOTE: Support for the Draft 6 definitions is provided for compatibility
2700Sstevel@tonic-gate  * only.  New applications/libraries should use the standard definitions.
2710Sstevel@tonic-gate  */
2720Sstevel@tonic-gate 
2730Sstevel@tonic-gate #if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
2740Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2750Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
2760Sstevel@tonic-gate 
2770Sstevel@tonic-gate #if	defined(__STDC__)
2780Sstevel@tonic-gate 
2790Sstevel@tonic-gate #if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
2800Sstevel@tonic-gate 
2810Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
2820Sstevel@tonic-gate #pragma redefine_extname ctime_r __posix_ctime_r
2830Sstevel@tonic-gate #pragma redefine_extname asctime_r __posix_asctime_r
2840Sstevel@tonic-gate extern char *asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
2850Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *);
2860Sstevel@tonic-gate #else  /* __PRAGMA_REDEFINE_EXTNAME */
2870Sstevel@tonic-gate 
2880Sstevel@tonic-gate extern char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD,
2890Sstevel@tonic-gate     char *_RESTRICT_KYWD);
2900Sstevel@tonic-gate extern char *__posix_ctime_r(const time_t *, char *);
2910Sstevel@tonic-gate 
2920Sstevel@tonic-gate #ifdef	__lint
2930Sstevel@tonic-gate 
2940Sstevel@tonic-gate #define	ctime_r __posix_ctime_r
2950Sstevel@tonic-gate #define	asctime_r __posix_asctime_r
2960Sstevel@tonic-gate 
2970Sstevel@tonic-gate #else	/* !__lint */
2980Sstevel@tonic-gate 
2990Sstevel@tonic-gate static char *
asctime_r(const struct tm * _RESTRICT_KYWD __tm,char * _RESTRICT_KYWD __buf)3000Sstevel@tonic-gate asctime_r(const struct tm *_RESTRICT_KYWD __tm, char *_RESTRICT_KYWD __buf)
3010Sstevel@tonic-gate {
3020Sstevel@tonic-gate 	return (__posix_asctime_r(__tm, __buf));
3030Sstevel@tonic-gate }
3040Sstevel@tonic-gate 
3050Sstevel@tonic-gate static char *
ctime_r(const time_t * __time,char * __buf)3060Sstevel@tonic-gate ctime_r(const time_t *__time, char *__buf)
3070Sstevel@tonic-gate {
3080Sstevel@tonic-gate 	return (__posix_ctime_r(__time, __buf));
3090Sstevel@tonic-gate }
3100Sstevel@tonic-gate 
3110Sstevel@tonic-gate #endif /* !__lint */
3120Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */
3130Sstevel@tonic-gate 
3140Sstevel@tonic-gate #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
3150Sstevel@tonic-gate 
3160Sstevel@tonic-gate extern char *asctime_r(const struct tm *, char *, int);
3170Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *, int);
3180Sstevel@tonic-gate 
3190Sstevel@tonic-gate #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
3200Sstevel@tonic-gate 
3210Sstevel@tonic-gate #else  /* __STDC__ */
3220Sstevel@tonic-gate 
3230Sstevel@tonic-gate #if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
3240Sstevel@tonic-gate 
3250Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
3260Sstevel@tonic-gate #pragma redefine_extname asctime_r __posix_asctime_r
3270Sstevel@tonic-gate #pragma redefine_extname ctime_r __posix_ctime_r
3280Sstevel@tonic-gate extern char *asctime_r();
3290Sstevel@tonic-gate extern char *ctime_r();
3300Sstevel@tonic-gate #else  /* __PRAGMA_REDEFINE_EXTNAME */
3310Sstevel@tonic-gate 
3320Sstevel@tonic-gate extern char *__posix_asctime_r();
3330Sstevel@tonic-gate extern char *__posix_ctime_r();
3340Sstevel@tonic-gate 
3350Sstevel@tonic-gate #ifdef	__lint
3360Sstevel@tonic-gate 
3370Sstevel@tonic-gate #define	asctime_r __posix_asctime_r
3380Sstevel@tonic-gate #define	ctime_r __posix_ctime_r
3390Sstevel@tonic-gate 
3400Sstevel@tonic-gate #else	/* !__lint */
3410Sstevel@tonic-gate 
3420Sstevel@tonic-gate static char *
asctime_r(__tm,__buf)3430Sstevel@tonic-gate asctime_r(__tm, __buf)
3440Sstevel@tonic-gate 	struct tm *__tm;
3450Sstevel@tonic-gate 	char *__buf;
3460Sstevel@tonic-gate {
3470Sstevel@tonic-gate 	return (__posix_asctime_r(__tm, __buf));
3480Sstevel@tonic-gate }
3490Sstevel@tonic-gate static char *
ctime_r(__time,__buf)3500Sstevel@tonic-gate ctime_r(__time, __buf)
3510Sstevel@tonic-gate 	time_t *__time;
3520Sstevel@tonic-gate 	char *__buf;
3530Sstevel@tonic-gate {
3540Sstevel@tonic-gate 	return (__posix_ctime_r(__time, __buf));
3550Sstevel@tonic-gate }
3560Sstevel@tonic-gate 
3570Sstevel@tonic-gate #endif /* !__lint */
3580Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */
3590Sstevel@tonic-gate 
3600Sstevel@tonic-gate #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
3610Sstevel@tonic-gate 
3620Sstevel@tonic-gate extern char *asctime_r();
3630Sstevel@tonic-gate extern char *ctime_r();
3640Sstevel@tonic-gate 
3650Sstevel@tonic-gate #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
3660Sstevel@tonic-gate 
3670Sstevel@tonic-gate #endif /* __STDC__ */
3680Sstevel@tonic-gate 
3690Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
3700Sstevel@tonic-gate 
3710Sstevel@tonic-gate #ifdef	__cplusplus
3720Sstevel@tonic-gate }
3730Sstevel@tonic-gate #endif
3740Sstevel@tonic-gate 
3750Sstevel@tonic-gate #endif	/* _TIME_H */
376