sendfile man page on Tru64

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
Tru64 logo
[printable version]

sendfile(2)							   sendfile(2)

NAME
       sendfile - Send the contents of a file through a socket

SYNOPSIS
       #include <sys/socket.h>

       ssize_t sendfile(
	       int socket,
	       int fd,
	       off_t offset,
	       size_t nbytes,
	       const struct iovec *hdtrl,
	       int flags );

PARAMETERS
       Specifies the socket file descriptor.  Specifies the file descriptor of
       the file that contains the contents to be sent.	 Specifies  the	 point
       within  the  file (offset) at which to start the data transfer.	Speci‐
       fies the number of bytes to send from the file. If the  value  is  zero
       (0),  data from the offset to the end of the file is sent.  Points to a
       two-entry array of iovec structures. The first  entry  contains	header
       information.  If	 the  iov_len  member is non-zero, the contents of the
       buffer are sent before any data from the file.

	      The second entry contains trailer information.  If  the  iov_len
	      member  is  non-zero,  the contents of the buffer are sent after
	      any data from the file.

	      If both iov_len members are NULL or if hdtrl is a NULL  pointer,
	      only the specified file contents are transferred.

	      See  write(2)  for information on the iovec structure.  Not cur‐
	      rently used.

DESCRIPTION
       The sendfile() function sends the specified contents  of	 a  file  only
       through a connected socket.

RETURN VALUES
       Upon  successful completion, the sendfile() function returns the number
       of bytes sent, including the header, trailer, and file contents. Other‐
       wise, the function returns a value of -1 and sets errno to indicate the
       error.

ERRORS
       If the sendfile() function fails, errno may be set to one of  the  fol‐
       lowing  values:	Non-blocking  I/O  is  enabled	(O_NONBLOCK),  and the
       requested operation would block.	 Addresses in  the  specified  address
       family  cannot  be used with this socket.  The socket parameter or file
       descriptor is not valid.	 The hdtrl parameter is not valid or there  is
       an  invalid pointer in the iovec structure.  A signal interrupted send‐
       file before any data was transmitted.  If some  data  was  transmitted,
       the  function returns the number of bytes sent before the interrupt and
       does not set errno to  [EINTR].	 The  offset  or  flags	 parameter  is
       invalid.

	      The  hdtrl  parameter,  or  a  length  in the iovec structure is
	      invalid.	There is insufficient space in the socket buffer.  The
	      system did not have sufficient memory to fulfill the request.  A
	      socket is connection-oriented but is not connected, has not com‐
	      pleted  the connect sequence with its peer, or is no longer con‐
	      nected to its peer.  The socket parameter refers to a file,  not
	      a	 socket.   The	socket	is not a TCP socket.  You attempted to
	      send on a socket that was connected, but either the remote  peer
	      or  localhost has closed the connection. If the process does not
	      have a signal handler for this  signal  (SIGPIPE),  the  default
	      action  is  to terminate the process.  The socket is marked non‐
	      blocking, and the requested operation would block.

SEE ALSO
       Functions:  connect(2),	read(2),  send(2),   shutdown(2),   socket(2),
       write(2), tcp(7).

								   sendfile(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Tru64

List of man pages available for Tru64

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net