1
.\" Copyright (C) The libssh2 project and its contributors.
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_sftp_statvfs 3 "22 May 2010" "libssh2" "libssh2"
5
libssh2_sftp_statvfs, libssh2_sftp_fstatvfs - get file system statistics
9
#include <libssh2_sftp.h>
12
libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path,
13
size_t path_len, LIBSSH2_SFTP_STATVFS *st);
16
libssh2_sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle,
17
LIBSSH2_SFTP_STATVFS *st)
20
These functions provide statvfs(2)-like operations and require
21
statvfs@openssh.com and fstatvfs@openssh.com extension support on the server.
23
\fIsftp\fP - SFTP instance as returned by
24
.BR libssh2_sftp_init(3)
26
\fIhandle\fP - SFTP File Handle as returned by
27
.BR libssh2_sftp_open_ex(3)
29
\fIpath\fP - full path of any file within the mounted file system.
31
\fIpath_len\fP - length of the full path.
33
\fIst\fP - Pointer to a LIBSSH2_SFTP_STATVFS structure to place file system
36
LIBSSH2_SFTP_STATVFS is a typedefed struct that is defined as below
39
struct _LIBSSH2_SFTP_STATVFS {
40
libssh2_uint64_t f_bsize; /* file system block size */
41
libssh2_uint64_t f_frsize; /* fragment size */
42
libssh2_uint64_t f_blocks; /* size of fs in f_frsize units */
43
libssh2_uint64_t f_bfree; /* # free blocks */
44
libssh2_uint64_t f_bavail; /* # free blocks for non-root */
45
libssh2_uint64_t f_files; /* # inodes */
46
libssh2_uint64_t f_ffree; /* # free inodes */
47
libssh2_uint64_t f_favail; /* # free inodes for non-root */
48
libssh2_uint64_t f_fsid; /* file system ID */
49
libssh2_uint64_t f_flag; /* mount flags */
50
libssh2_uint64_t f_namemax; /* maximum filename length */
54
It is unspecified whether all members of the returned struct have meaningful
55
values on all file systems.
57
The field \fIf_flag\fP is a bit mask. Bits are defined as follows:
58
.IP LIBSSH2_SFTP_ST_RDONLY
60
.IP LIBSSH2_SFTP_ST_NOSUID
61
Set-user-ID/set-group-ID bits are ignored by \fBexec\fP(3).
63
Returns 0 on success or negative on failure. If used in non-blocking mode, it
64
returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
65
LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a failure per se.
67
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
69
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
71
\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
73
\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
74
received on the socket, or an SFTP operation caused an errorcode to be returned
79
.BR libssh2_sftp_open_ex(3)