Contenues dansTrouver plus de documentationRessources d'assistance comprises | Télécharger cet ouvrage au format PDF (584 Ko)
Appendix A Changes in Derived TypesThe default 32-bit compilation environment is identical to historical Solaris operating environment releases with respect to derived types and their sizes. In the 64-bit compilation environment, some changes in derived types are necessary. These changed derived types are highlighted in the tables that follow. Notice that although the 32-bit and 64-bit compilation environments differ, the same set of headers is used for both, with the appropriate definitions determined by the compilation options. To better understand the options available to the applications developer, it helps to understand the _ILP32 and _LP64 feature test macros. Table A–1 Feature Test Macros
The following examples illustrate the use of feature test macros so that the correct definitions are visible, depending on the compilation environment. Example A–1 size_t Defined in _LP64#if defined(_LP64) typedef ulong_t size_t; /* size of something in bytes */ #else typedef uint_t size_t; /* (historical version) */ #endif When building a 64-bit application with the definition in this example, Example A–2 uid_t Defined in _LP64#if defined(_LP64) typedef int uid_t; /* UID type */ #else typedef long uid_t; /* (historical version) */ #endif In either of these examples, the same end result would have been obtained had
the ILP32 type representation been identical to the LP64 type representation. For
example, if in the 32-bit application environment,
Table A–2 lists the derived
types that have changed. Notice that the types listed under the _ILP32 feature
test macro match those in Solaris 2.6, before 64–bit support was added to the
Solaris software. When building a 32-bit application, the derived types available
to the developer match those in the _ILP32 column. When building
a 64-bit application, the derived types match those listed in the _LP64 column.
All of these types are defined in <sys/types.h>, with the
exception of the When reviewing these tables, remember that in the 32-bit environment,
Table A–3 lists the derived types specific to the Large Files compilation environment. These types are only defined if the feature test macro _LARGEFILE64_SOURCE is defined. Notice that the ILP32 compilation environment has been preserved with the previous Solaris 2.6 release. Table A–3 Changed Derived Types — Large File Specific
Table A–4 lists the changed derived types with respect to the value of _FILE_OFFSET_BITS. You cannot compile an application with both _LP64 defined and _FILE_OFFSET_BITS==32. By default, if _LP64 is defined, then _FILE_OFFSET_BITS==64. If _ILP32 is defined, and _FILE_OFFSET_BITS is not defined, then by default, _FILE_OFFSET_BITS==32. These rules are defined in the <sys/feature_tests.h> header file. Table A–4 Changed Derived Types — FILE_OFFSET_BITS Value
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||