xref: /titanic_41/usr/src/lib/libast/common/features/tmlib (revision 5bbb4db2c3f208d12bf0fd11769728f9e5ba66a2)
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