'\" t
.\" Title: gfs_pio_sendfile
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 12 Aug 2015
.\" Manual: Gfarm
.\" Source: Gfarm
.\" Language: English
.\"
.TH "GFS_PIO_SENDFILE" "3" "12 Aug 2015" "Gfarm" "Gfarm"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gfs_pio_sendfile \- receive a Gfarm file to local machine
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include
.fi
.ft
.HP \w'gfarm_error_t\ gfs_pio_sendfile('u
.BI "gfarm_error_t\ gfs_pio_sendfile(GFS_File\ " "w_gf" ", gfarm_off_t\ " "w_off" ", int\ " "r_fd" ", gfarm_off_t\ " "r_off" ", gfarm_off_t\ " "len" ", gfarm_off_t\ *\ " "sentp" ");"
.SH "DESCRIPTION"
.PP
Sends
\fIlen\fR
bytes of data from the position specified by the offset
\fIr_off\fR
in a local file which is pointed by a file descriptor
\fIr_fd\fR, to the position specified by the offset
\fIw_off\fR
of a Gfarm file
\fIw_gf\fR\&. If len is \-1, this function transfers until the end of the file\&. The transfered bytes will be stored to the memory pointed by
\fIsentp\fR
when
\fIsentp\fR
is not
\fBNULL\fR\&. If
\fIlen\fR
is a positive value, and the value pointed by
\fIsentp\fR
is less than
\fIlen\fR, that means the transfer reached
EOF\&.
.SH "RETURN VALUES"
.PP
\fBGFARM_ERR_NO_ERROR\fR
.RS 4
The function terminated successfully\&.
.RE
.PP
\fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR
.RS 4
\fIgf\fR
does not specify a regular file\&.
.RE
.PP
\fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR
.RS 4
The file descripter specified by
\fIgf\fR
is not a valid or is not open for reading\&.
.RE
.PP
\fBGFARM_ERR_NO_FILE_SYSTEM_NODE\fR
.RS 4
There is no available file system node\&.
.RE
.PP
\fBGFARM_ERR_NO_MEMORY\fR
.RS 4
Insufficient memory was available\&.
.RE
.PP
Others
.RS 4
An error except the above occurred\&. The reason is shown by
\fBgfarm_error_string\fR(3)\&.
.RE
.SH "SEE ALSO"
.PP
\fBgfs_pio_create\fR(3),
\fBgfs_pio_open\fR(3),
\fBgfs_pio_write\fR(3),
\fBgfs_pio_recvfile\fR(3)