xref: /titanic_51/usr/src/lib/libast/common/features/tmlib (revision 9e39c5ba00a55fa05777cc94b148296af305e135)
1set	prototyped
2
3tst	tzset_environ note{ tzset() bypasses user getenv() }end execute{
4	#include <time.h>
5	extern char**	environ;
6	extern char*	tzname[2];
7	#if _STD_
8	extern char* getenv(char* s)
9	#else
10	extern char* getenv(s)
11	char*	s;
12	#endif
13	{
14		return "foo0bar";
15	}
16	int main()
17	{
18		tzset();
19		return tzname[0] && !strcmp(tzname[0], "foo") &&
20		       tzname[1] && !strcmp(tzname[1], "bar");
21	}
22}end
23
24if ( _tzset_environ ) {
25	#define tmlocaltime(p)		_tm_localtime(p)
26
27	extern struct tm*		_tm_localtime(const time_t*);
28}
29else {
30	#define tmlocaltime(p)		localtime(p)
31}
32endif
33