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 /* 26bfe60e20Sdamico * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 277c478bd9Sstevel@tonic-gate * Use is subject to license terms. 287c478bd9Sstevel@tonic-gate */ 296eaad1d3SGarrett D'Amore /* 306eaad1d3SGarrett D'Amore * Copyright 2010 Nexenta Systems, Inc. Al rights reserved. 31*2d08521bSGarrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org> 326eaad1d3SGarrett D'Amore */ 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #ifndef _TIME_H 357c478bd9Sstevel@tonic-gate #define _TIME_H 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h> 387c478bd9Sstevel@tonic-gate #include <iso/time_iso.h> 397c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 407c478bd9Sstevel@tonic-gate (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__) 417c478bd9Sstevel@tonic-gate #include <sys/types.h> 427c478bd9Sstevel@tonic-gate #include <sys/time_impl.h> 437c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) ... */ 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate /* 467c478bd9Sstevel@tonic-gate * Allow global visibility for symbols defined in 477c478bd9Sstevel@tonic-gate * C++ "std" namespace in <iso/time_iso.h>. 487c478bd9Sstevel@tonic-gate */ 497c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 507c478bd9Sstevel@tonic-gate using std::size_t; 517c478bd9Sstevel@tonic-gate using std::clock_t; 527c478bd9Sstevel@tonic-gate using std::time_t; 537c478bd9Sstevel@tonic-gate using std::tm; 547c478bd9Sstevel@tonic-gate using std::asctime; 557c478bd9Sstevel@tonic-gate using std::clock; 567c478bd9Sstevel@tonic-gate using std::ctime; 577c478bd9Sstevel@tonic-gate using std::difftime; 587c478bd9Sstevel@tonic-gate using std::gmtime; 597c478bd9Sstevel@tonic-gate using std::localtime; 607c478bd9Sstevel@tonic-gate using std::mktime; 617c478bd9Sstevel@tonic-gate using std::time; 627c478bd9Sstevel@tonic-gate using std::strftime; 637c478bd9Sstevel@tonic-gate #endif 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate #ifdef __cplusplus 667c478bd9Sstevel@tonic-gate extern "C" { 677c478bd9Sstevel@tonic-gate #endif 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate #ifndef _CLOCKID_T 707c478bd9Sstevel@tonic-gate #define _CLOCKID_T 717c478bd9Sstevel@tonic-gate typedef int clockid_t; 727c478bd9Sstevel@tonic-gate #endif 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #ifndef _TIMER_T 757c478bd9Sstevel@tonic-gate #define _TIMER_T 767c478bd9Sstevel@tonic-gate typedef int timer_t; 777c478bd9Sstevel@tonic-gate #endif 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate #if defined(__STDC__) 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \ 827c478bd9Sstevel@tonic-gate (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 837c478bd9Sstevel@tonic-gate (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT) 847c478bd9Sstevel@tonic-gate extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, 857c478bd9Sstevel@tonic-gate struct tm *_RESTRICT_KYWD); 867c478bd9Sstevel@tonic-gate extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD, 877c478bd9Sstevel@tonic-gate struct tm *_RESTRICT_KYWD); 887c478bd9Sstevel@tonic-gate #endif 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 917c478bd9Sstevel@tonic-gate defined(_XPG4) || defined(__EXTENSIONS__) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate #ifdef _STRPTIME_DONTZERO 947c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 957c478bd9Sstevel@tonic-gate #pragma redefine_extname strptime __strptime_dontzero 967c478bd9Sstevel@tonic-gate #else /* __PRAGMA_REDEFINE_EXTNAME */ 977c478bd9Sstevel@tonic-gate extern char *__strptime_dontzero(const char *, const char *, struct tm *); 987c478bd9Sstevel@tonic-gate #define strptime __strptime_dontzero 997c478bd9Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */ 1007c478bd9Sstevel@tonic-gate #endif /* _STRPTIME_DONTZERO */ 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate extern char *strptime(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, 1037c478bd9Sstevel@tonic-gate struct tm *_RESTRICT_KYWD); 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */ 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 1087c478bd9Sstevel@tonic-gate (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__) 1097c478bd9Sstevel@tonic-gate /* 1107c478bd9Sstevel@tonic-gate * Neither X/Open nor POSIX allow the inclusion of <signal.h> for the 1117c478bd9Sstevel@tonic-gate * definition of the sigevent structure. Both require the inclusion 1127c478bd9Sstevel@tonic-gate * of <signal.h> and <time.h> when using the timer_create() function. 1137c478bd9Sstevel@tonic-gate * However, X/Open also specifies that the sigevent structure be defined 1147c478bd9Sstevel@tonic-gate * in <time.h> as described in the header <signal.h>. This prevents 1157c478bd9Sstevel@tonic-gate * compiler warnings for applications that only include <time.h> and not 1167c478bd9Sstevel@tonic-gate * also <signal.h>. The sigval union and the sigevent structure is 1177c478bd9Sstevel@tonic-gate * therefore defined both here and in <sys/siginfo.h> which gets included 1187c478bd9Sstevel@tonic-gate * via inclusion of <signal.h>. 1197c478bd9Sstevel@tonic-gate */ 1207c478bd9Sstevel@tonic-gate #ifndef _SIGVAL 1217c478bd9Sstevel@tonic-gate #define _SIGVAL 1227c478bd9Sstevel@tonic-gate union sigval { 1237c478bd9Sstevel@tonic-gate int sival_int; /* integer value */ 1247c478bd9Sstevel@tonic-gate void *sival_ptr; /* pointer value */ 1257c478bd9Sstevel@tonic-gate }; 1267c478bd9Sstevel@tonic-gate #endif /* _SIGVAL */ 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate #ifndef _SIGEVENT 1297c478bd9Sstevel@tonic-gate #define _SIGEVENT 1307c478bd9Sstevel@tonic-gate struct sigevent { 1317c478bd9Sstevel@tonic-gate int sigev_notify; /* notification mode */ 1327c478bd9Sstevel@tonic-gate int sigev_signo; /* signal number */ 1337c478bd9Sstevel@tonic-gate union sigval sigev_value; /* signal value */ 1347c478bd9Sstevel@tonic-gate void (*sigev_notify_function)(union sigval); 1357c478bd9Sstevel@tonic-gate pthread_attr_t *sigev_notify_attributes; 1367c478bd9Sstevel@tonic-gate int __sigev_pad2; 1377c478bd9Sstevel@tonic-gate }; 1387c478bd9Sstevel@tonic-gate #endif /* _SIGEVENT */ 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate extern int clock_getres(clockid_t, struct timespec *); 1417c478bd9Sstevel@tonic-gate extern int clock_gettime(clockid_t, struct timespec *); 1427c478bd9Sstevel@tonic-gate extern int clock_settime(clockid_t, const struct timespec *); 1437c478bd9Sstevel@tonic-gate extern int timer_create(clockid_t, struct sigevent *_RESTRICT_KYWD, 1447c478bd9Sstevel@tonic-gate timer_t *_RESTRICT_KYWD); 1457c478bd9Sstevel@tonic-gate extern int timer_delete(timer_t); 1467c478bd9Sstevel@tonic-gate extern int timer_getoverrun(timer_t); 1477c478bd9Sstevel@tonic-gate extern int timer_gettime(timer_t, struct itimerspec *); 1487c478bd9Sstevel@tonic-gate extern int timer_settime(timer_t, int, const struct itimerspec *_RESTRICT_KYWD, 1497c478bd9Sstevel@tonic-gate struct itimerspec *_RESTRICT_KYWD); 1507c478bd9Sstevel@tonic-gate 1517c478bd9Sstevel@tonic-gate extern int nanosleep(const struct timespec *, struct timespec *); 1527c478bd9Sstevel@tonic-gate extern int clock_nanosleep(clockid_t, int, 1537c478bd9Sstevel@tonic-gate const struct timespec *, struct timespec *); 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */ 1567c478bd9Sstevel@tonic-gate 1577c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX) || \ 1587c478bd9Sstevel@tonic-gate defined(__EXTENSIONS__) 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate extern void tzset(void); 1617c478bd9Sstevel@tonic-gate extern char *tzname[2]; 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate /* CLK_TCK marked as LEGACY in SUSv2 and removed in SUSv3 */ 1647c478bd9Sstevel@tonic-gate #if !defined(_XPG6) || defined(__EXTENSIONS__) 1657c478bd9Sstevel@tonic-gate #ifndef CLK_TCK 1667c478bd9Sstevel@tonic-gate extern long _sysconf(int); /* System Private interface to sysconf() */ 1677c478bd9Sstevel@tonic-gate #define CLK_TCK ((clock_t)_sysconf(3)) /* clock ticks per second */ 1687c478bd9Sstevel@tonic-gate /* 3 is _SC_CLK_TCK */ 1697c478bd9Sstevel@tonic-gate #endif 1707c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */ 1717c478bd9Sstevel@tonic-gate 1727c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \ 1737c478bd9Sstevel@tonic-gate defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) 1747c478bd9Sstevel@tonic-gate extern long timezone; 1757c478bd9Sstevel@tonic-gate extern int daylight; 1767c478bd9Sstevel@tonic-gate #endif 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)... */ 1797c478bd9Sstevel@tonic-gate 180bfe60e20Sdamico #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 181bfe60e20Sdamico defined(__EXTENSIONS__) 1826eaad1d3SGarrett D'Amore extern time_t timegm(struct tm *); 1837c478bd9Sstevel@tonic-gate extern int cftime(char *, char *, const time_t *); 1847c478bd9Sstevel@tonic-gate extern int ascftime(char *, const char *, const struct tm *); 1857c478bd9Sstevel@tonic-gate extern long altzone; 1867c478bd9Sstevel@tonic-gate #endif 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 1897c478bd9Sstevel@tonic-gate defined(_XPG4_2) || defined(__EXTENSIONS__) 1907c478bd9Sstevel@tonic-gate extern struct tm *getdate(const char *); 1917c478bd9Sstevel@tonic-gate #ifdef _REENTRANT 1927c478bd9Sstevel@tonic-gate #undef getdate_err 1937c478bd9Sstevel@tonic-gate #define getdate_err *(int *)_getdate_err_addr() 1947c478bd9Sstevel@tonic-gate extern int *_getdate_err_addr(void); 1957c478bd9Sstevel@tonic-gate #else 1967c478bd9Sstevel@tonic-gate extern int getdate_err; 1977c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */ 1987c478bd9Sstevel@tonic-gate #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */ 1997c478bd9Sstevel@tonic-gate 2007c478bd9Sstevel@tonic-gate #else /* __STDC__ */ 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate extern int cftime(), ascftime(); 2037c478bd9Sstevel@tonic-gate extern void tzset(); 2046eaad1d3SGarrett D'Amore extern time_t timegm(); 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate #ifdef _STRPTIME_DONTZERO 2077c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 2087c478bd9Sstevel@tonic-gate #pragma redefine_extname strptime __strptime_dontzero 2097c478bd9Sstevel@tonic-gate #else /* __PRAGMA_REDEFINE_EXTNAME */ 2107c478bd9Sstevel@tonic-gate extern char *__strptime_dontzero(); 2117c478bd9Sstevel@tonic-gate #define strptime __strptime_dontzero 2127c478bd9Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */ 2137c478bd9Sstevel@tonic-gate #endif /* _STRPTIME_DONTZERO */ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate extern char *strptime(); 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \ 2187c478bd9Sstevel@tonic-gate (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 2197c478bd9Sstevel@tonic-gate (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT) 2207c478bd9Sstevel@tonic-gate extern struct tm *gmtime_r(); 2217c478bd9Sstevel@tonic-gate extern struct tm *localtime_r(); 2227c478bd9Sstevel@tonic-gate #endif 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate extern long timezone, altzone; 2257c478bd9Sstevel@tonic-gate extern int daylight; 2267c478bd9Sstevel@tonic-gate extern char *tzname[2]; 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__) 2297c478bd9Sstevel@tonic-gate extern struct tm *getdate(); 2307c478bd9Sstevel@tonic-gate #ifdef _REENTRANT 2317c478bd9Sstevel@tonic-gate #undef getdate_err 2327c478bd9Sstevel@tonic-gate #define getdate_err *(int *)_getdate_err_addr() 2337c478bd9Sstevel@tonic-gate extern int *_getdate_err_addr(); 2347c478bd9Sstevel@tonic-gate #else 2357c478bd9Sstevel@tonic-gate extern int getdate_err; 2367c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */ 2377c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */ 2387c478bd9Sstevel@tonic-gate 2397c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gate /* 2427c478bd9Sstevel@tonic-gate * ctime_r() & asctime_r() prototypes are defined here. 2437c478bd9Sstevel@tonic-gate */ 2447c478bd9Sstevel@tonic-gate 2457c478bd9Sstevel@tonic-gate /* 2467c478bd9Sstevel@tonic-gate * Previous releases of Solaris, starting at 2.3, provided definitions of 2477c478bd9Sstevel@tonic-gate * various functions as specified in POSIX.1c, Draft 6. For some of these 2487c478bd9Sstevel@tonic-gate * functions, the final POSIX 1003.1c standard had a different number of 2497c478bd9Sstevel@tonic-gate * arguments and return values. 2507c478bd9Sstevel@tonic-gate * 2517c478bd9Sstevel@tonic-gate * The following segment of this header provides support for the standard 2527c478bd9Sstevel@tonic-gate * interfaces while supporting applications written under earlier 2537c478bd9Sstevel@tonic-gate * releases. The application defines appropriate values of the feature 2547c478bd9Sstevel@tonic-gate * test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate 2557c478bd9Sstevel@tonic-gate * whether it was written to expect the Draft 6 or standard versions of 2567c478bd9Sstevel@tonic-gate * these interfaces, before including this header. This header then 2577c478bd9Sstevel@tonic-gate * provides a mapping from the source version of the interface to an 2587c478bd9Sstevel@tonic-gate * appropriate binary interface. Such mappings permit an application 2597c478bd9Sstevel@tonic-gate * to be built from libraries and objects which have mixed expectations 2607c478bd9Sstevel@tonic-gate * of the definitions of these functions. 2617c478bd9Sstevel@tonic-gate * 2627c478bd9Sstevel@tonic-gate * For applications using the Draft 6 definitions, the binary symbol is the 2637c478bd9Sstevel@tonic-gate * same as the source symbol, and no explicit mapping is needed. For the 2647c478bd9Sstevel@tonic-gate * standard interface, the function func() is mapped to the binary symbol 2657c478bd9Sstevel@tonic-gate * _posix_func(). The preferred mechanism for the remapping is a compiler 2667c478bd9Sstevel@tonic-gate * #pragma. If the compiler does not provide such a #pragma, the header file 2677c478bd9Sstevel@tonic-gate * defines a static function func() which calls the _posix_func() version; 2687c478bd9Sstevel@tonic-gate * this has to be done instead of #define since POSIX specifies that an 2697c478bd9Sstevel@tonic-gate * application can #undef the symbol and still be bound to the correct 2707c478bd9Sstevel@tonic-gate * implementation. Unfortunately, the statics confuse lint so we fallback to 2717c478bd9Sstevel@tonic-gate * #define in that case. 2727c478bd9Sstevel@tonic-gate * 2737c478bd9Sstevel@tonic-gate * NOTE: Support for the Draft 6 definitions is provided for compatibility 2747c478bd9Sstevel@tonic-gate * only. New applications/libraries should use the standard definitions. 2757c478bd9Sstevel@tonic-gate */ 2767c478bd9Sstevel@tonic-gate 2777c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_REENTRANT) || \ 2787c478bd9Sstevel@tonic-gate (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 2797c478bd9Sstevel@tonic-gate (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate #if defined(__STDC__) 2827c478bd9Sstevel@tonic-gate 2837c478bd9Sstevel@tonic-gate #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) 2847c478bd9Sstevel@tonic-gate 2857c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 2867c478bd9Sstevel@tonic-gate #pragma redefine_extname ctime_r __posix_ctime_r 2877c478bd9Sstevel@tonic-gate #pragma redefine_extname asctime_r __posix_asctime_r 2887c478bd9Sstevel@tonic-gate extern char *asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD); 2897c478bd9Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *); 2907c478bd9Sstevel@tonic-gate #else /* __PRAGMA_REDEFINE_EXTNAME */ 2917c478bd9Sstevel@tonic-gate 2927c478bd9Sstevel@tonic-gate extern char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD, 2937c478bd9Sstevel@tonic-gate char *_RESTRICT_KYWD); 2947c478bd9Sstevel@tonic-gate extern char *__posix_ctime_r(const time_t *, char *); 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate #ifdef __lint 2977c478bd9Sstevel@tonic-gate 2987c478bd9Sstevel@tonic-gate #define ctime_r __posix_ctime_r 2997c478bd9Sstevel@tonic-gate #define asctime_r __posix_asctime_r 3007c478bd9Sstevel@tonic-gate 3017c478bd9Sstevel@tonic-gate #else /* !__lint */ 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate static char * 3047c478bd9Sstevel@tonic-gate asctime_r(const struct tm *_RESTRICT_KYWD __tm, char *_RESTRICT_KYWD __buf) 3057c478bd9Sstevel@tonic-gate { 3067c478bd9Sstevel@tonic-gate return (__posix_asctime_r(__tm, __buf)); 3077c478bd9Sstevel@tonic-gate } 3087c478bd9Sstevel@tonic-gate 3097c478bd9Sstevel@tonic-gate static char * 3107c478bd9Sstevel@tonic-gate ctime_r(const time_t *__time, char *__buf) 3117c478bd9Sstevel@tonic-gate { 3127c478bd9Sstevel@tonic-gate return (__posix_ctime_r(__time, __buf)); 3137c478bd9Sstevel@tonic-gate } 3147c478bd9Sstevel@tonic-gate 3157c478bd9Sstevel@tonic-gate #endif /* !__lint */ 3167c478bd9Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */ 3177c478bd9Sstevel@tonic-gate 3187c478bd9Sstevel@tonic-gate #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ 3197c478bd9Sstevel@tonic-gate 3207c478bd9Sstevel@tonic-gate extern char *asctime_r(const struct tm *, char *, int); 3217c478bd9Sstevel@tonic-gate extern char *ctime_r(const time_t *, char *, int); 3227c478bd9Sstevel@tonic-gate 3237c478bd9Sstevel@tonic-gate #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ 3247c478bd9Sstevel@tonic-gate 3257c478bd9Sstevel@tonic-gate #else /* __STDC__ */ 3267c478bd9Sstevel@tonic-gate 3277c478bd9Sstevel@tonic-gate #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 3307c478bd9Sstevel@tonic-gate #pragma redefine_extname asctime_r __posix_asctime_r 3317c478bd9Sstevel@tonic-gate #pragma redefine_extname ctime_r __posix_ctime_r 3327c478bd9Sstevel@tonic-gate extern char *asctime_r(); 3337c478bd9Sstevel@tonic-gate extern char *ctime_r(); 3347c478bd9Sstevel@tonic-gate #else /* __PRAGMA_REDEFINE_EXTNAME */ 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate extern char *__posix_asctime_r(); 3377c478bd9Sstevel@tonic-gate extern char *__posix_ctime_r(); 3387c478bd9Sstevel@tonic-gate 3397c478bd9Sstevel@tonic-gate #ifdef __lint 3407c478bd9Sstevel@tonic-gate 3417c478bd9Sstevel@tonic-gate #define asctime_r __posix_asctime_r 3427c478bd9Sstevel@tonic-gate #define ctime_r __posix_ctime_r 3437c478bd9Sstevel@tonic-gate 3447c478bd9Sstevel@tonic-gate #else /* !__lint */ 3457c478bd9Sstevel@tonic-gate 3467c478bd9Sstevel@tonic-gate static char * 3477c478bd9Sstevel@tonic-gate asctime_r(__tm, __buf) 3487c478bd9Sstevel@tonic-gate struct tm *__tm; 3497c478bd9Sstevel@tonic-gate char *__buf; 3507c478bd9Sstevel@tonic-gate { 3517c478bd9Sstevel@tonic-gate return (__posix_asctime_r(__tm, __buf)); 3527c478bd9Sstevel@tonic-gate } 3537c478bd9Sstevel@tonic-gate static char * 3547c478bd9Sstevel@tonic-gate ctime_r(__time, __buf) 3557c478bd9Sstevel@tonic-gate time_t *__time; 3567c478bd9Sstevel@tonic-gate char *__buf; 3577c478bd9Sstevel@tonic-gate { 3587c478bd9Sstevel@tonic-gate return (__posix_ctime_r(__time, __buf)); 3597c478bd9Sstevel@tonic-gate } 3607c478bd9Sstevel@tonic-gate 3617c478bd9Sstevel@tonic-gate #endif /* !__lint */ 3627c478bd9Sstevel@tonic-gate #endif /* __PRAGMA_REDEFINE_EXTNAME */ 3637c478bd9Sstevel@tonic-gate 3647c478bd9Sstevel@tonic-gate #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ 3657c478bd9Sstevel@tonic-gate 3667c478bd9Sstevel@tonic-gate extern char *asctime_r(); 3677c478bd9Sstevel@tonic-gate extern char *ctime_r(); 3687c478bd9Sstevel@tonic-gate 3697c478bd9Sstevel@tonic-gate #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ 3707c478bd9Sstevel@tonic-gate 3717c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 3727c478bd9Sstevel@tonic-gate 3737c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */ 3747c478bd9Sstevel@tonic-gate 375*2d08521bSGarrett D'Amore 376*2d08521bSGarrett D'Amore #if defined(_XPG7) || !defined(_STRICT_SYMBOLS) 377*2d08521bSGarrett D'Amore 378*2d08521bSGarrett D'Amore #ifndef _LOCALE_T 379*2d08521bSGarrett D'Amore #define _LOCALE_T 380*2d08521bSGarrett D'Amore typedef struct locale *locale_t; 381*2d08521bSGarrett D'Amore #endif 382*2d08521bSGarrett D'Amore 383*2d08521bSGarrett D'Amore #if defined(__STDC__) 384*2d08521bSGarrett D'Amore extern size_t strftime_l(char *_RESTRICT_KYWD, size_t, 385*2d08521bSGarrett D'Amore const char *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD, locale_t); 386*2d08521bSGarrett D'Amore #else /* __STDC__ */ 387*2d08521bSGarrett D'Amore extern size_t strftime_l(); 388*2d08521bSGarrett D'Amore #endif /* __STDC__ */ 389*2d08521bSGarrett D'Amore 390*2d08521bSGarrett D'Amore #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */ 391*2d08521bSGarrett D'Amore 3927c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3937c478bd9Sstevel@tonic-gate } 3947c478bd9Sstevel@tonic-gate #endif 3957c478bd9Sstevel@tonic-gate 3967c478bd9Sstevel@tonic-gate #endif /* _TIME_H */ 397