send_file64()--Send a File over a Socket Connection
Syntax
#include <sys/types.h> #include <sys/socket.h> int send_file64(int *socket_descriptor, struct sf_parms64 *sf_struct, int flags)
Service Program Name: QSOSRV1
Default Public Authority: *USE
Threadsafe: Conditional; see Usage Notes.
The send_file64() function is used to send the contents of an open file over an existing socket connection.
The send_file64() API is a combination of the IFS read() and the sockets send() and close() APIs. Socket applications that transmit a file over a socket connection can, under certain circumstances, obtain improved performance by using send_file64().
send_file64() is enabled for large files. It is capable of operating on files larger than 2 GB minus 1 byte. For additional information about the parameters, authorities required, return values, error conditions, error messages, and other usage notes, see send_file()--Send a File over a Socket Connection.
Parameters
- socket_descriptor
- (Input/Output) A pointer to the socket descriptor that is to be written
to.
- sf_struct
- (Input/Output) A pointer to the send_file64 structure that contains the
following:
- The header buffer and length.
- The file descriptor, the offset into the file, the file size, and the
number of bytes to send from the file.
- The trailer buffer and length.
- The number of bytes of data that were sent.
The structure pointed to by the sf_struct parameter is defined in <sys/socket.h>.
struct sf_parms64 { void *header_data; size_t header_length; int file_descriptor; unsigned long long file_size; long long file_offset; long long file_bytes; void *trailer_data; size_t trailer_length; unsigned long long bytes_sent; }
- The header buffer and length.
- flags
- (Input) A flag value that controls what is done with the socket connection after the data has been transmitted.
Authorities
No authorization is required.
Usage Notes
- When you develop in C-based languages, the prototypes for the 64-bit APIs
are normally hidden. To use the send_file64() API, you must compile
the source with the _LARGE_FILE_API macro defined.
- All of the Usage Notes for send_file() apply to send_file64(). See Usage Notes in the send_file() API.
API introduced: V4R4