'\" te .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved .\" 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 or http://www.opensolaris.org/os/licensing. 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] .TH LFCOMPILE64 5 "Jan 26, 1998" .SH NAME lfcompile64 \- transitional compilation environment .SH DESCRIPTION .sp .LP All 64-bit applications can manipulate large files by default. The transitional interfaces described on this page can be used by 32-bit and 64-bit applications to manipulate large files. .sp .LP In the transitional compilation environment, explicit 64-bit functions, structures, and types are added to the \fBAPI.\fR Compiling in this environment allows both 32-bit and 64-bit applications to access files whose size is greater than or equal to 2 Gbyte ( 2^31 bytes). .sp .LP The transitional compilation environment exports all the explicit 64-bit functions (\fIxxx\fR\fB64()\fR) and types in addition to all the regular functions (\fIxxx\fR\fB()\fR) and types. Both \fIxxx\fR\fB()\fR and \fIxxx\fR\fB64()\fR functions are available to the program source. A 32-bit application must use the \fIxxx\fR\fB64()\fR functions in order to access large files. See the \fBlf64\fR(5) manual page for a complete listing of the 64-bit transitional interfaces. .sp .LP The transitional compilation environment differs from the large file compilation environment, wherein the underlying interfaces are bound to 64-bit functions, structures, and types. An application compiled in the large file compilation environment is able to use the \fIxxx\fR\fB()\fR source interfaces to access both large and small files, rather than having to explicitly utilize the transitional \fIxxx\fR\fB64()\fR interface calls to access large files. See the \fBlfcompile\fR(5) manual page for more information regarding the large file compilation environment. .sp .LP Applications may combine objects produced in the large file compilation environment with objects produced in the transitional compilation environment, but must be careful with respect to interoperability between those objects. Applications should not declare global variables of types whose sizes change between compilation environments. .sp .LP For applications that do not wish to conform to the POSIX or X/Open specifications, the 64-bit transitional interfaces are available by default. No compile-time flags need to be set. .SS "Access to Additional Large File Interfaces" .sp .LP Applications that wish to access the transitional interfaces as well as the POSIX or X/Open specification-conforming interfaces should use the following compilation methods and set whichever feature test macros are appropriate to obtain the desired environment (see \fBstandards\fR(5)). .RS +4 .TP .ie t \(bu .el o Set the compile-time flag \fB_LARGEFILE64_SOURCE\fR to 1 before including any headers. .RE .RS +4 .TP .ie t \(bu .el o Use the \fBgetconf\fR(1) command with one or more of the following arguments: .RE .sp .sp .TS box; c | c l | l . \fBargument\fR \fBpurpose\fR _ \fBLFS64_CFLAGS\fR T{ obtain compilation flags necessary to enable the transitional compilation environment T} \fBLFS64_LDFLAGS\fR obtain link editor options \fBLFS64_LIBS\fR obtain link library names \fBLFS64_LINTFLAGS\fR obtain lint options .TE .SH EXAMPLES .sp .LP In the following examples, the transitional compilation environment is accessed by invoking the \fBgetconf\fR utility with one of the arguments listed in the table above. The additional large file interfaces are accessed either by specifying \fB-D_LARGEFILE64_SOURCE\fR or by invoking the \fBgetconf\fR utility with the arguments listed above. .sp .LP The example that uses the form of command substitution specifying the command within parentheses preceded by a dollar sign can be executed only in a POSIX-conforming shell such as the Korn Shell (see \fBksh\fR(1)). In a shell that is not POSIX-conforming, such as the Bourne Shell (see \fBsh\fR(1)) and the C Shell (see \fBcsh\fR(1)), the command must be enclosed within grave accent marks. .LP \fBExample 1 \fRAn example of compiling a program using transitional interfaces such as \fBlseek64()\fR and \fBfopen64()\fR: .sp .in +2 .nf $ c89 -D_LARGEFILE64_SOURCE \e $(getconf LFS64_CFLAGS) a.c \e $(getconf LFS64_LDFLAGS) \e $(getconf LFS64_LIBS) .fi .in -2 .LP \fBExample 2 \fRAn example of running lint on a program using transitional interfaces: .sp .in +2 .nf % lint -D_LARGEFILE64_SOURCE \e \(gagetconf LFS64_LINTFLAGS\(ga \&.\|.\|. \e \(gagetconf LFS64_LIBS\(ga .fi .in -2 .SH SEE ALSO .sp .LP \fBgetconf\fR(1), \fBlseek\fR(2), \fBfopen\fR(3C), \fBlf64\fR(5), \fBstandards\fR(5)