| United States-English |
|
|
|
![]() |
Release Notes for HP-UX 10.30: HP 9000 Computers > Chapter 4 Major Changes for HP-UX 10.20Large Files |
|
For 10.20, HP-UX now supports files up to 128GB in size. The prior limit was 2GB. This section summarizes the large files features. For a complete description of the HP large file implementation, see the HP-UX 10.20 Large Files White Paper in /usr/share/doc (see the section "Online Documents" in Chapter 1 for the exact file name and content description). Many UNIX vendors support a 32-bit operating system, which inherently has a limitation of 2GB when representing file sizes and offsets. The Large Files Summit, an independent working group consisting of many UNIX vendors, has addressed this limitation and agreed on an interface that enables a 32-bit operating system to support file sizes greater than 2GB. For details, see the website http://www.sas.com/standards/large.file. The HP-UX implementation of large files follows the Summit specifications. Large files (files greater than 2GB) are supported through a new set of system calls and libc routines, as well as through HP-UX system administration and user commands. The implementation is supported on UFS and JFS Version 3 file systems, but not on NFS. In addition, the implementation is completely binary compatible with prior releases of HP-UX. There are two ways to support large files:
These are the data types that are 64 bits in the alternate compile environment:
These data types remain 32 bits in the default environment, although the data types also have 64-bit equivalents in the 32-bit environment. The names end in "64" or "64_t", such as fsblkcnt_t and fsblkcnt64_t. Below are the data structures that use the above data types.
In the alternate compile environment, the structures contain the 64-bit fields listed. In the default environment, these structures do not change, but there are parallel structures, such as flock64 for flock. Below are the subroutine interfaces that are different in the alternate compile environment, usually because they use one of the types or structures above. The name of the corresponding routine usable in the default environment is also listed:
New interfaces have been introduced for fseek() and ftell() because the POSIX definitions do not support file sizes larger than 2GB on machines that use 32-bit int values.
The following commands have also been enhanced to provide command-line support for large files:
Complete details of the data types, structures, interfaces, and commands can be found in the Large Files White Paper. The current small file (less than 2GB) environment has not changed. The implementation has only introduced new interfaces that enable applications to manipulate large files. Therefore, as long as an application has no need to create, open, or stat large files, no code modification or recompilation is required. Also, because the existing environment is not changing, existing code that is recompiled on a system that supports large files will still behave as it did before the recompilation. When an existing application that does not utilize the new interfaces to access large files encounters a large file, an error will be returned. These applications can expect both the open() and stat() calls to fail with EOVERFLOW. This protection mechanism prevents applications unaware of large files from accessing a large file because the application may not be able to correctly handle large files. There is also a file system-based protection mechanism to protect unaware applications from encountering large files. A file system can be designated as one of the following:
The mechanism is administered through the file system administration commands:
Full details can be found in both the white paper and associated manpages. Large files are supported in two programming/compile environments. In the first, existing data types keep their old size and large files are accessed by explicitly calling the new 64-bit routines and using the 64-bit data structures and types. These new interfaces enable the full access of files up to the supported limit. Current 32-bit interfaces keep their old sizes and continue to work on files less than 2GB. The new and old interfaces can be mixed in the same program. Specific compilation flags are required to make these 64-bit interfaces available:
In the second environment, existing standard data types and routines use 64-bit fields, allowing programs using standard POSIX and XPG interfaces to support large files. Again, compilation flags are used to determine the interfaces sizes:
Complete details of the programming/compile environments can be found in the white paper. As stated above, if your application does not need to operate on file data beyond 2GB, you do not have to make changes to the application. The built-in protection mechanisms will help prevent the unaware application from accessing a large file. However, if the application needs to support the large file interfaces, there are a few alternatives to consider:
Complete information can be found in the white paper. Regardless of which interfaces are used (either the standard POSIX interfaces or *64() interfaces), all exhibit the same behavior on files less than 2GB. For example, the *64() interfaces can be used on small files just as they are used on large files. A small file that was created/modified by a large file application can be modified/accessed by a small file application, and vice versa. There are no incompatibilities between the two types of interfaces when operating on files less than 2GB. With large files, it is possible for a developer to mix and match 32- and 64-bit interfaces and data types. For this reason, many of the routines can return a new error, EOVERFLOW, indicating that the operation or returned data is too large for the environment or passed data structure. This can occur when a 64-bit call is made using a 32-bit data structure, or when an unconverted application tries to open a large file. The details of the error associated with each interface can be found in the interfaces' manpage. The commands listed in the above "Commands" subsection support operations on large files. In addition, commands that display or accept as arguments byte, word, and line counts also handle values larger than 2GB. For example, wc(1) displays byte, word, and line counts that can be larger than 2GB; find(1) accepts size arguments that are larger than 2GB, and compress(1) operates on files larger than 2GB. An exception to this general rule is tail(1), which is (and has always been) limited to a 20K buffer for display. Therefore, tail(1) only displays up to 20K bytes of data, regardless of the line number argument that is passed. See the manpage for complete details. The dd, fbackup/frecover, and vxdump/vxrestore commands support large file archival and retrieval. The fbackup and vxdump data formats have been changed to accommodate the larger file sizes. The archives created by these versions of the commands are readable only by the corresponding frecover and vxdump, and not by their earlier versions. Archives created by older versions of fbackup and vxdump are readable by the new versions of frecover and vxdump. Standards-conforming backup commands such as tar, cpio, ftio, and pax do not support archiving files greater than 2GB. These commands have limitations associated with standards and interoperability that prevents their support of large files. The manpages contain complete details. The dump/restore commands do not support files greater than 2GB. There can be some performance degradation due to the use of 64-bit data types, which, on 32-bit architectures, require more instructions to manipulate than 32-bit types. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||