5003N/A * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4481N/A * Returns a pointer to the zone ID portion of the given zoneinfo file 4481N/A * name, or NULL if the given string doesn't contain "zoneinfo/". 0N/A * Returns a path name created from the given 'dir' and 'name' under 0N/A * UNIX. This function allocates memory for the pathname calling 4481N/A * malloc(). NULL is returned if malloc() fails. 0N/A * Scans the specified directory and its subdirectories to find a 5066N/A * If file is symbolic link, then the contents it points to are in buf. 5066N/A * Returns a zone ID if found, otherwise, NULL is returned. 0N/A * Skip '.' and '..' (and possibly other .* files) 4481N/A * Skip "ROC", "posixrules", and "localtime". 4481N/A * Skip the "src" and "tab" directories on Solaris. 4481N/A * Performs Linux specific mapping and returns a zone ID 0N/A * if found. Otherwise, NULL is returned. 1628N/A * no spec of the file format available. This parsing assumes that 1628N/A * there's one line of an Olson tzid followed by a '\n', no 1628N/A * leading or trailing spaces, no comments. 0N/A * If it's a symlink, get the link name and its zone ID part. (The 0N/A * older versions of timeconfig created a symlink as described in 0N/A * the Red Hat man page. It was changed in 1999 to create a copy 0N/A * of a zoneinfo file. It's no longer possible to get the zone ID 0N/A * If it's a regular file, we need to find out the same zoneinfo file 5066N/A * If initial symbolic link resolution failed, we should treat target 0N/A * Those file* functions mimic the UNIX stream io functions. This is 0N/A * because of the limitation of the number of open files on Solaris 0N/A * (32-bit mode only) due to the System V ABI. 0N/A int magic;
/* -1 to distinguish from the real FILE */ 0N/A int fd;
/* file descriptor */ 0N/A char *
ptr;
/* current read pointer */ 0N/A * It assumes read open. 0N/A * Allocate struct iobuffer and its buffer 0N/A * This implementation assumes that n is large enough and the line 0N/A * separator is '\n'. 0N/A if ((p - s) == (n -
1)) {
0N/A#
endif /* not __sparcv9 */ 4481N/A * Performs Solaris dependent mapping. Returns a zone ID if 4481N/A * found. Otherwise, NULL is returned. Solaris libc looks up 0N/A * as an environment variable. 0N/A /* quick check for comment lines */ 0N/A if (c ==
'"' || c ==
'\'') {
0N/A * PSARC/2001/383: quoted string support 0N/A for (s = p; (c = *s) !=
'\0' && c !=
'\n'; s++) {
0N/A /* No '\\' is supported here. */ 4481N/A * Retruns a zone ID of Solaris when the TZ value is "localtime". 4481N/A * First, it tries scf. If scf fails, it looks for the same file as 4481N/A /* scf specific variables */ 4481N/A /* Gets the length of the zone ID string */ 0N/A * findJavaTZ_md() maps platform time zone ID to Java time zone ID 0N/A * trys some libc implementation dependent mappings. If it still 0N/A * can't map to a Java time zone ID, it falls back to the GMT+/-hh:mm 0N/A * form. `country', which can be null, is not used for UNIX platforms. 0N/A * Ignore "posix/" prefix. 4481N/A * Returns a GMT-offset-based zone ID. (e.g., "GMT-08:00") 0N/A /* Note that the time offset direction is opposite. */