/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RTC_H
#define _RTC_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Global include file for the runtime configuration support.
*/
#include <time.h>
#include <machdep.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Linker configuration files are designed to be mapped into memory
* and accessed directly. Hence, the layout of the data must follow
* byte order and alignment rules for the program examining it.
*
* From its initial design through the release of Solaris 10, runtime
* linker configuration files started with a configuration header (Rtc_head).
* The role of Rtc_head is to provide a table of contents to the remainder
* of the file. It tells what information is contained in the file,
* and the offset (relative to the base of the Rtc_head structure)
* within the file at which each item can be found. These offsets are
* 32-bit values. Linker configuration files are 32-bit limited, even
* for 64-bit platforms.
*
* It should be noted that Rtc_head contains no information that can be
* used to identify the type of program that created the file (byte order,
* elf class, and machine architecture). This leads to some difficulties:
* - Interpreting a config file using a program with the opposite
* byte order can crash the program.
* - Structure layout differences can cause a 64-bit version of the
* program to fail to read a 32-bit config file correctly, or
* vice versa. This was not an issue on sparc (both 32 and 64-bit
* happen to lay out the same way). However, 32 and 64-bit X86
* have differing alignment rules.
* - The file command cannot easily identify a linker configuration
* file, and simply reports them as "data".
* Initially, the design of of these files assumed that a given file
* would be readable by any system. Experience shows that this is wrong.
* A linker config file is ABI specific, much like an object file. It should
* only be interpreted by a compatible program.
*
* Linker configuration files now start with an Rtc_id structure, followed
* immediately by Rtc_head. Rtc_id provides the information necessary to
* detect the type of program that wrote the file, in a manner that allows
* backwards compatibility with pre-existing config files:
* - We can detect an old config file, because they do not start
* with the characters "\077RLC". In this case, we assume the
* file is compatible with the program interpreting it, and that
* Rtc_head is the first thing in the file.
* - Solaris 10 and older will refuse to handle a config
* file that has an Rtc_id, because they will interpret
* the "\077RLC" signature as the ch_version field of Rtc_head,
* and will reject the version as being invalid.
* - Rtc_id is specified such that its size will be 16 bytes
* on all systems, sufficient to align Rtc_head on any system, and
* to provide future expansion room.
* - Offsets to data in the file continue to be specified relative
* to the Rtc_head address, meaning that existing software will
* continue to work with little or no modification.
*/
/*
* Identification header.
*
* This is defined in usr/src/common/sgsrtcid/sgsrtcid.h
* so that file(1) can also access it.
*/
#include <sgsrtcid.h>
/*
* Configuration header.
*/
typedef struct {
/* is specific to */
/* by the configuration info */
} Rtc_head;
/* these may exist without a */
/* memory reservation (see -a) */
/*
* Object descriptor.
*/
typedef struct {
} Rtc_obj;
/* containing objects */
/* configuration file specific */
/*
* Directory and file descriptors. The configuration cache (cd_dir) points to
* an array of directory descriptors, this in turn point to their associated
* arrays of file descriptors. Both of these provide sequential access for
* configuration file validation (directory, and possible file stat()'s).
*/
typedef struct {
} Rtc_dir;
typedef struct {
} Rtc_file;
#define RTC_VER_NONE 0
/*
* Environment variable descriptor. The configuration cache (ch_env) points to
* an array of these descriptors.
*/
typedef struct {
} Rtc_env;
/*
* Filter descriptor. The configuration cache (ch_flt) points to an array of
* these descriptors.
*/
typedef struct {
} Rtc_fltr;
typedef struct {
} Rtc_flte;
#ifdef __cplusplus
}
#endif
#endif /* _RTC_H */