Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_ftruncate64z(2) OSS System Calls Reference Manual
For C applications, a macro to map ftruncate() to spt_ftruncate64z() is available when you use
the #define SPT_THREAD_AWARE_XNONBLOCK and the #define
_FILE_OFFSET_BITS 64 preprocessor directives before including spthread.h or when you
use equivalent compiler command options to compile the application.
For C++ applications, an alias to map ftruncate() to spt_ftruncate64z() is available when you
use the #define SPT_THREAD_AWARE_PRAGMA_XNONBLOCK and the #define
_FILE_OFFSET_BITS 64 preprocessor directives before including spthread.h or when you
use equivalent compiler command options to compile the application.
For C applications, a macro to map ftruncate64() to spt_ftruncate64z() is available when you
use the #define SPT_THREAD_AWARE_XNONBLOCK and the #define
_LARGEFILE64_SOURCE 1 preprocessor directives before including spthread.h or when
you use equivalent compiler command options to compile the application.
For C++ applications, an alias to map ftruncate64() to spt_ftruncate64z() is available when
you use the #define SPT_THREAD_AWARE_PRAGMA_XNONBLOCK and the #define
_LARGEFILE64_SOURCE 1 preprocessor directives before including spthread.h or when
you use equivalent compiler command options to compile the application.
A direct application call to spt_ftruncatez() is automatically mapped to spt_ftruncate64z( )
when you use the #define _FILE_OFFSET_BITS 64 preprocessor directive before including
spthread.h or when you use an equivalent compiler command option to compile the application.
To use this function in a threaded application that uses the Standard POSIX Threads library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks:
• Include the spthread.h header file in the application.
• Compile the application using the _SPT_MODEL_ feature test macro or equivalent
compiler command option in addition to any other feature test macros in use.
• Link the application to the zsptdll library (/G/system/zdllnnn/zsptdll).
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the spt_ftruncate64z() function sets errno to the correspond-
ing value:
[EBADF] The filedes parameter does not specify a valid file descriptor open for writing.
[EFBIG] The length parameter is greater than the minimum of 2 gigabytes minus 1 byte
and the maximum file size established during file open.
[EINTR] The function was interrupted by a signal before any data arrived.
[EINVAL] One of these conditions occurred:
• The file pointed to by the filedes parameter is not a regular file.
• The value specified for the length parameter was less than 0 (zero).
7−250 Hewlett-Packard Company 527186-023