geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1.5 KiB

  1. .TH libssh2_sftp_read 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
  2. .SH NAME
  3. libssh2_sftp_read - read data from an SFTP handle
  4. .SH SYNOPSIS
  5. #include <libssh2.h>
  6. #include <libssh2_sftp.h>
  7. ssize_t
  8. libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
  9. .SH DESCRIPTION
  10. \fIhandle\fP is the SFTP File Handle as returned by
  11. .BR libssh2_sftp_open_ex(3)
  12. \fIbuffer\fP is a pointer to a pre-allocated buffer of at least
  13. \fIbuffer_maxlen\fP bytes to read data into.
  14. Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is modelled
  15. after the POSIX
  16. .BR read(2)
  17. function and uses the same calling semantics.
  18. .BR libssh2_sftp_read(3)
  19. will attempt to read as much as possible however it may not fill all of buffer
  20. if the file pointer reaches the end or if further reads would cause the socket
  21. to block.
  22. .SH RETURN VALUE
  23. Number of bytes actually populated into buffer, or negative on failure.
  24. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
  25. LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
  26. .SH ERRORS
  27. \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
  28. \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
  29. \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
  30. \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
  31. received on the socket, or an SFTP operation caused an errorcode to be
  32. returned by the server.
  33. .SH SEE ALSO
  34. .BR libssh2_sftp_open_ex(3)
  35. .BR libssh2_sftp_read(3)