.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "GFS_PIO_TRUNCATE" "3" "12 January 2005" "Gfarm" ""
.SH NAME
gfs_pio_truncate \- truncate a file to a specified length
.SH SYNOPSIS
.sp
\fB#include
.sp
char *gfs_pio_truncate (GFS_File \fIgf\fB, file_offset_t \fIlength\fB);
\fR
.SH "DESCRIPTION"
.PP
The \fBgfs_pio_truncate()\fR function truncates the
regular file \fIgf\fR to the \fIlength\fR
bytes.
.PP
If the file was previously shorter than the length, it is extended,
and the extended part is filled by zero bytes.
.PP
The file pointer is not changed.
.PP
You must specify GFS_FILE_MODE_WRITE in opening
the file, because it must be open for writing.
.SH "RETURN VALUES"
.TP
\fBNULL\fR
The function terminated successfully.
.TP
\fBGFARM_ERR_NO_MEMORY\fR
Insufficient memory was available.
.TP
\fBOthers\fR
An error except the above occurred. The reason is shown by its
pointed strings.
.SH "SEE ALSO"
.PP
\fBgfs_pio_create\fR(3),
\fBgfs_pio_open\fR(3)