xref: /titanic_51/usr/src/head/time.h (revision dcdfe824b3dff2df12578b936adf1daf000aa129)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5bfe60e20Sdamico  * Common Development and Distribution License (the "License").
6bfe60e20Sdamico  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
27ba3594baSGarrett D'Amore  *
28bfe60e20Sdamico  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
297c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
307c478bd9Sstevel@tonic-gate  */
316eaad1d3SGarrett D'Amore /*
326eaad1d3SGarrett D'Amore  * Copyright 2010 Nexenta Systems, Inc.  Al rights reserved.
33*dcdfe824SRobert Mustacchi  * Copyright 2016 Joyent, Inc.
346eaad1d3SGarrett D'Amore  */
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifndef _TIME_H
377c478bd9Sstevel@tonic-gate #define	_TIME_H
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
407c478bd9Sstevel@tonic-gate #include <iso/time_iso.h>
41*dcdfe824SRobert Mustacchi /*
42*dcdfe824SRobert Mustacchi  * C11 requires sys/time_impl.h for the definition of the struct timespec.
43*dcdfe824SRobert Mustacchi  */
447c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
45*dcdfe824SRobert Mustacchi 	(_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__) || defined(_STDC_C11)
467c478bd9Sstevel@tonic-gate #include <sys/types.h>
477c478bd9Sstevel@tonic-gate #include <sys/time_impl.h>
487c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) ... */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate /*
517c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
527c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/time_iso.h>.
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
557c478bd9Sstevel@tonic-gate using std::size_t;
567c478bd9Sstevel@tonic-gate using std::clock_t;
577c478bd9Sstevel@tonic-gate using std::time_t;
587c478bd9Sstevel@tonic-gate using std::tm;
597c478bd9Sstevel@tonic-gate using std::asctime;
607c478bd9Sstevel@tonic-gate using std::clock;
617c478bd9Sstevel@tonic-gate using std::ctime;
627c478bd9Sstevel@tonic-gate using std::difftime;
637c478bd9Sstevel@tonic-gate using std::gmtime;
647c478bd9Sstevel@tonic-gate using std::localtime;
657c478bd9Sstevel@tonic-gate using std::mktime;
667c478bd9Sstevel@tonic-gate using std::time;
677c478bd9Sstevel@tonic-gate using std::strftime;
687c478bd9Sstevel@tonic-gate #endif
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
717c478bd9Sstevel@tonic-gate extern "C" {
727c478bd9Sstevel@tonic-gate #endif
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate #ifndef _CLOCKID_T
757c478bd9Sstevel@tonic-gate #define	_CLOCKID_T
767c478bd9Sstevel@tonic-gate typedef int	clockid_t;
777c478bd9Sstevel@tonic-gate #endif
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #ifndef _TIMER_T
807c478bd9Sstevel@tonic-gate #define	_TIMER_T
817c478bd9Sstevel@tonic-gate typedef int	timer_t;
827c478bd9Sstevel@tonic-gate #endif
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
857c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
867c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
877c478bd9Sstevel@tonic-gate extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD,
887c478bd9Sstevel@tonic-gate 			struct tm *_RESTRICT_KYWD);
897c478bd9Sstevel@tonic-gate extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD,
907c478bd9Sstevel@tonic-gate 			struct tm *_RESTRICT_KYWD);
917c478bd9Sstevel@tonic-gate #endif
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
947c478bd9Sstevel@tonic-gate 	defined(_XPG4) || defined(__EXTENSIONS__)
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #ifdef _STRPTIME_DONTZERO
977c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
987c478bd9Sstevel@tonic-gate #pragma	redefine_extname strptime __strptime_dontzero
997c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
1007c478bd9Sstevel@tonic-gate extern char *__strptime_dontzero(const char *, const char *, struct tm *);
1017c478bd9Sstevel@tonic-gate #define	strptime	__strptime_dontzero
1027c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
1037c478bd9Sstevel@tonic-gate #endif	/* _STRPTIME_DONTZERO */
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate extern char *strptime(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
1067c478bd9Sstevel@tonic-gate 		struct tm *_RESTRICT_KYWD);
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1117c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
1127c478bd9Sstevel@tonic-gate /*
1137c478bd9Sstevel@tonic-gate  * Neither X/Open nor POSIX allow the inclusion of <signal.h> for the
1147c478bd9Sstevel@tonic-gate  * definition of the sigevent structure.  Both require the inclusion
1157c478bd9Sstevel@tonic-gate  * of <signal.h> and <time.h> when using the timer_create() function.
1167c478bd9Sstevel@tonic-gate  * However, X/Open also specifies that the sigevent structure be defined
1177c478bd9Sstevel@tonic-gate  * in <time.h> as described in the header <signal.h>.  This prevents
1187c478bd9Sstevel@tonic-gate  * compiler warnings for applications that only include <time.h> and not
1197c478bd9Sstevel@tonic-gate  * also <signal.h>.  The sigval union and the sigevent structure is
1207c478bd9Sstevel@tonic-gate  * therefore defined both here and in <sys/siginfo.h> which gets included
1217c478bd9Sstevel@tonic-gate  * via inclusion of <signal.h>.
1227c478bd9Sstevel@tonic-gate  */
1237c478bd9Sstevel@tonic-gate #ifndef	_SIGVAL
1247c478bd9Sstevel@tonic-gate #define	_SIGVAL
1257c478bd9Sstevel@tonic-gate union sigval {
1267c478bd9Sstevel@tonic-gate 	int	sival_int;	/* integer value */
1277c478bd9Sstevel@tonic-gate 	void	*sival_ptr;	/* pointer value */
1287c478bd9Sstevel@tonic-gate };
1297c478bd9Sstevel@tonic-gate #endif	/* _SIGVAL */
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate #ifndef	_SIGEVENT
1327c478bd9Sstevel@tonic-gate #define	_SIGEVENT
1337c478bd9Sstevel@tonic-gate struct sigevent {
1347c478bd9Sstevel@tonic-gate 	int		sigev_notify;	/* notification mode */
1357c478bd9Sstevel@tonic-gate 	int		sigev_signo;	/* signal number */
1367c478bd9Sstevel@tonic-gate 	union sigval	sigev_value;	/* signal value */
1377c478bd9Sstevel@tonic-gate 	void		(*sigev_notify_function)(union sigval);
1387c478bd9Sstevel@tonic-gate 	pthread_attr_t	*sigev_notify_attributes;
1397c478bd9Sstevel@tonic-gate 	int		__sigev_pad2;
1407c478bd9Sstevel@tonic-gate };
1417c478bd9Sstevel@tonic-gate #endif	/* _SIGEVENT */
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate extern int clock_getres(clockid_t, struct timespec *);
1447c478bd9Sstevel@tonic-gate extern int clock_gettime(clockid_t, struct timespec *);
1457c478bd9Sstevel@tonic-gate extern int clock_settime(clockid_t, const struct timespec *);
1467c478bd9Sstevel@tonic-gate extern int timer_create(clockid_t, struct sigevent *_RESTRICT_KYWD,
1477c478bd9Sstevel@tonic-gate 		timer_t *_RESTRICT_KYWD);
1487c478bd9Sstevel@tonic-gate extern int timer_delete(timer_t);
1497c478bd9Sstevel@tonic-gate extern int timer_getoverrun(timer_t);
1507c478bd9Sstevel@tonic-gate extern int timer_gettime(timer_t, struct itimerspec *);
1517c478bd9Sstevel@tonic-gate extern int timer_settime(timer_t, int, const struct itimerspec *_RESTRICT_KYWD,
1527c478bd9Sstevel@tonic-gate 		struct itimerspec *_RESTRICT_KYWD);
1537c478bd9Sstevel@tonic-gate 
1547c478bd9Sstevel@tonic-gate extern int nanosleep(const struct timespec *, struct timespec *);
1557c478bd9Sstevel@tonic-gate extern int clock_nanosleep(clockid_t, int,
1567c478bd9Sstevel@tonic-gate 	const struct timespec *, struct timespec *);
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX) || \
1617c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate extern void tzset(void);
1647c478bd9Sstevel@tonic-gate extern char *tzname[2];
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /* CLK_TCK marked as LEGACY in SUSv2 and removed in SUSv3 */
1677c478bd9Sstevel@tonic-gate #if !defined(_XPG6) || defined(__EXTENSIONS__)
1687c478bd9Sstevel@tonic-gate #ifndef CLK_TCK
1697c478bd9Sstevel@tonic-gate extern long _sysconf(int);	/* System Private interface to sysconf() */
1707c478bd9Sstevel@tonic-gate #define	CLK_TCK	((clock_t)_sysconf(3))	/* clock ticks per second */
1717c478bd9Sstevel@tonic-gate 				/* 3 is _SC_CLK_TCK */
1727c478bd9Sstevel@tonic-gate #endif
1737c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1767c478bd9Sstevel@tonic-gate 	defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1777c478bd9Sstevel@tonic-gate extern long timezone;
1787c478bd9Sstevel@tonic-gate extern int daylight;
1797c478bd9Sstevel@tonic-gate #endif
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)... */
1827c478bd9Sstevel@tonic-gate 
183bfe60e20Sdamico #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
184bfe60e20Sdamico 	defined(__EXTENSIONS__)
1856eaad1d3SGarrett D'Amore extern time_t timegm(struct tm *);
1867c478bd9Sstevel@tonic-gate extern int cftime(char *, char *, const time_t *);
1877c478bd9Sstevel@tonic-gate extern int ascftime(char *, const char *, const struct tm *);
1887c478bd9Sstevel@tonic-gate extern long altzone;
1897c478bd9Sstevel@tonic-gate #endif
1907c478bd9Sstevel@tonic-gate 
1917c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1927c478bd9Sstevel@tonic-gate 	defined(_XPG4_2) || defined(__EXTENSIONS__)
1937c478bd9Sstevel@tonic-gate extern struct tm *getdate(const char *);
1947c478bd9Sstevel@tonic-gate #ifdef	_REENTRANT
1957c478bd9Sstevel@tonic-gate #undef getdate_err
1967c478bd9Sstevel@tonic-gate #define	getdate_err *(int *)_getdate_err_addr()
1977c478bd9Sstevel@tonic-gate extern int *_getdate_err_addr(void);
1987c478bd9Sstevel@tonic-gate #else
1997c478bd9Sstevel@tonic-gate extern int getdate_err;
2007c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */
2017c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate /*
2047c478bd9Sstevel@tonic-gate  * ctime_r() & asctime_r() prototypes are defined here.
2057c478bd9Sstevel@tonic-gate  */
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate /*
2087c478bd9Sstevel@tonic-gate  * Previous releases of Solaris, starting at 2.3, provided definitions of
2097c478bd9Sstevel@tonic-gate  * various functions as specified in POSIX.1c, Draft 6.  For some of these
2107c478bd9Sstevel@tonic-gate  * functions, the final POSIX 1003.1c standard had a different number of
2117c478bd9Sstevel@tonic-gate  * arguments and return values.
2127c478bd9Sstevel@tonic-gate  *
2137c478bd9Sstevel@tonic-gate  * The following segment of this header provides support for the standard
2147c478bd9Sstevel@tonic-gate  * interfaces while supporting applications written under earlier
2157c478bd9Sstevel@tonic-gate  * releases.  The application defines appropriate values of the feature
2167c478bd9Sstevel@tonic-gate  * test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate
2177c478bd9Sstevel@tonic-gate  * whether it was written to expect the Draft 6 or standard versions of
2187c478bd9Sstevel@tonic-gate  * these interfaces, before including this header.  This header then
2197c478bd9Sstevel@tonic-gate  * provides a mapping from the source version of the interface to an
2207c478bd9Sstevel@tonic-gate  * appropriate binary interface.  Such mappings permit an application
2217c478bd9Sstevel@tonic-gate  * to be built from libraries and objects which have mixed expectations
2227c478bd9Sstevel@tonic-gate  * of the definitions of these functions.
2237c478bd9Sstevel@tonic-gate  *
2247c478bd9Sstevel@tonic-gate  * For applications using the Draft 6 definitions, the binary symbol is the
2257c478bd9Sstevel@tonic-gate  * same as the source symbol, and no explicit mapping is needed.  For the
2267c478bd9Sstevel@tonic-gate  * standard interface, the function func() is mapped to the binary symbol
2277c478bd9Sstevel@tonic-gate  * _posix_func().  The preferred mechanism for the remapping is a compiler
2287c478bd9Sstevel@tonic-gate  * #pragma.  If the compiler does not provide such a #pragma, the header file
2297c478bd9Sstevel@tonic-gate  * defines a static function func() which calls the _posix_func() version;
2307c478bd9Sstevel@tonic-gate  * this has to be done instead of #define since POSIX specifies that an
2317c478bd9Sstevel@tonic-gate  * application can #undef the symbol and still be bound to the correct
2327c478bd9Sstevel@tonic-gate  * implementation.  Unfortunately, the statics confuse lint so we fallback to
2337c478bd9Sstevel@tonic-gate  * #define in that case.
2347c478bd9Sstevel@tonic-gate  *
2357c478bd9Sstevel@tonic-gate  * NOTE: Support for the Draft 6 definitions is provided for compatibility
2367c478bd9Sstevel@tonic-gate  * only.  New applications/libraries should use the standard definitions.
2377c478bd9Sstevel@tonic-gate  */
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate #if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
2407c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2417c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate #if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
2467c478bd9Sstevel@tonic-gate #pragma redefine_extname ctime_r __posix_ctime_r
2477c478bd9Sstevel@tonic-gate #pragma redefine_extname asctime_r __posix_asctime_r
2487c478bd9Sstevel@tonic-gate extern char *asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
2497c478bd9Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *);
2507c478bd9Sstevel@tonic-gate #else  /* __PRAGMA_REDEFINE_EXTNAME */
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate extern char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD,
2537c478bd9Sstevel@tonic-gate     char *_RESTRICT_KYWD);
2547c478bd9Sstevel@tonic-gate extern char *__posix_ctime_r(const time_t *, char *);
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate #ifdef	__lint
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate #define	ctime_r __posix_ctime_r
2597c478bd9Sstevel@tonic-gate #define	asctime_r __posix_asctime_r
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate #else	/* !__lint */
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate static char *
2647c478bd9Sstevel@tonic-gate asctime_r(const struct tm *_RESTRICT_KYWD __tm, char *_RESTRICT_KYWD __buf)
2657c478bd9Sstevel@tonic-gate {
2667c478bd9Sstevel@tonic-gate 	return (__posix_asctime_r(__tm, __buf));
2677c478bd9Sstevel@tonic-gate }
2687c478bd9Sstevel@tonic-gate 
2697c478bd9Sstevel@tonic-gate static char *
2707c478bd9Sstevel@tonic-gate ctime_r(const time_t *__time, char *__buf)
2717c478bd9Sstevel@tonic-gate {
2727c478bd9Sstevel@tonic-gate 	return (__posix_ctime_r(__time, __buf));
2737c478bd9Sstevel@tonic-gate }
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate #endif /* !__lint */
2767c478bd9Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */
2777c478bd9Sstevel@tonic-gate 
2787c478bd9Sstevel@tonic-gate #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate extern char *asctime_r(const struct tm *, char *, int);
2817c478bd9Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *, int);
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
2867c478bd9Sstevel@tonic-gate 
2872d08521bSGarrett D'Amore 
2882d08521bSGarrett D'Amore #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
2892d08521bSGarrett D'Amore 
2902d08521bSGarrett D'Amore #ifndef	_LOCALE_T
2912d08521bSGarrett D'Amore #define	_LOCALE_T
292732efd55SDan McDonald typedef struct _locale *locale_t;
2932d08521bSGarrett D'Amore #endif
2942d08521bSGarrett D'Amore 
2952d08521bSGarrett D'Amore extern size_t strftime_l(char *_RESTRICT_KYWD, size_t,
2962d08521bSGarrett D'Amore 	const char *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD, locale_t);
2972d08521bSGarrett D'Amore 
2982d08521bSGarrett D'Amore #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
2992d08521bSGarrett D'Amore 
300*dcdfe824SRobert Mustacchi #if !defined(_STRICT_SYMBOLS) || defined(_STDC_C11)
301*dcdfe824SRobert Mustacchi 
302*dcdfe824SRobert Mustacchi /*
303*dcdfe824SRobert Mustacchi  * Note, the C11 standard requires that all the various base values that are
304*dcdfe824SRobert Mustacchi  * passed into timespec_get() be non-zero. Hence why TIME_UTC starts at one.
305*dcdfe824SRobert Mustacchi  */
306*dcdfe824SRobert Mustacchi #define	TIME_UTC	0x1		/* timespec_get base */
307*dcdfe824SRobert Mustacchi 
308*dcdfe824SRobert Mustacchi extern int timespec_get(struct timespec *, int);
309*dcdfe824SRobert Mustacchi #endif
310*dcdfe824SRobert Mustacchi 
3117c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3127c478bd9Sstevel@tonic-gate }
3137c478bd9Sstevel@tonic-gate #endif
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate #endif	/* _TIME_H */
316