Lines Matching defs:localtime
103 #define LOCALTIME_FILE "/etc/localtime"
144 * but should be /usr/share/zoneinfo by default. /etc/localtime is not guaranteed to exist on
145 * all platforms, so if it doesn't, try $TZDIR/localtime, then /usr/share/zoneinfo/locatime
148 * besides, modern Linux distribution don't make /etc/localtime a symlink but a straight copy of
163 #define LOCALTIME_FILE1 "/etc/localtime"
166 const char* localtime;
192 fd1 = open( scan->localtime, O_RDONLY );
194 D(" can't open %s: %s\n", scan->localtime, strerror(errno) );
308 char* localtime = NULL;
343 /* try to find the localtime file */
344 localtime = LOCALTIME_FILE1;
345 if ( access( localtime, R_OK ) != 0 ) {
348 p = bufprint( p, end, "%s/%s", tzdir, "localtime" );
354 localtime = temp;
356 localtime = strdup(localtime);
357 D( "%s: found localtime file as %s\n", __FUNCTION__, localtime );
360 /* if the localtime file is a link, make a quick check */
361 len = readlink( localtime, temp, sizeof(temp)-1 );
370 D( "%s: found zoneinfo timezone %s from %s symlink\n", __FUNCTION__, tz, localtime );
374 __FUNCTION__, localtime, temp );
383 if ( stat( localtime, &scan->localtime_st ) < 0 ) {
385 localtime );
389 scan->localtime = localtime;
399 if (localtime)
400 free(localtime);
688 struct tm* tm = localtime(&t);