1libssh2_sftp_statvfs(3) libssh2 libssh2_sftp_statvfs(3)
2
3
4
6 libssh2_sftp_statvfs, libssh2_sftp_fstatvfs - get file system statis‐
7 tics
8
10 #include <libssh2.h>
11 #include <libssh2_sftp.h>
12
13 int
14 libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path,
15 size_t path_len, LIBSSH2_SFTP_STATVFS *st);
16
17 int
18 libssh2_sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle,
19 LIBSSH2_SFTP_STATVFS *st)
20
22 These functions provide statvfs(2)-like operations and require
23 statvfs@openssh.com and fstatvfs@openssh.com extension support on the
24 server.
25
26 sftp - SFTP instance as returned by libssh2_sftp_init(3)
27
28 handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3)
29
30 path - full path of any file within the mounted file system.
31
32 path_len - length of the full path.
33
34 st - Pointer to a LIBSSH2_SFTP_STATVFS structure to place file system
35 statistics into.
36
38 LIBSSH2_SFTP_STATVFS is a typedefed struct that is defined as below
39
40 struct _LIBSSH2_SFTP_STATVFS {
41 libssh2_uint64_t f_bsize; /* file system block size */
42 libssh2_uint64_t f_frsize; /* fragment size */
43 libssh2_uint64_t f_blocks; /* size of fs in f_frsize units */
44 libssh2_uint64_t f_bfree; /* # free blocks */
45 libssh2_uint64_t f_bavail; /* # free blocks for non-root */
46 libssh2_uint64_t f_files; /* # inodes */
47 libssh2_uint64_t f_ffree; /* # free inodes */
48 libssh2_uint64_t f_favail; /* # free inodes for non-root */
49 libssh2_uint64_t f_fsid; /* file system ID */
50 libssh2_uint64_t f_flag; /* mount flags */
51 libssh2_uint64_t f_namemax; /* maximum filename length */
52 };
53
54 It is unspecified whether all members of the returned struct have mean‐
55 ingful values on all file systems.
56
57 The field f_flag is a bit mask. Bits are defined as follows:
58
59 LIBSSH2_SFTP_ST_RDONLY
60 Read-only file system.
61
62 LIBSSH2_SFTP_ST_NOSUID
63 Set-user-ID/set-group-ID bits are ignored by exec(3).
64
66 Returns 0 on success or negative on failure. If used in non-blocking
67 mode, it returns LIBSSH2_ERROR_EAGAIN when it would otherwise block.
68 While LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a
69 failure per se.
70
72 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
73
74 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
75
76 LIBSSH2_ERROR_SOCKET_TIMEOUT -
77
78 LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was re‐
79 ceived on the socket, or an SFTP operation caused an errorcode to be
80 returned by the server.
81
83 Added in libssh2 1.2.6
84
86 libssh2_sftp_open_ex(3)
87
88
89
90libssh2 22 May 2010 libssh2_sftp_statvfs(3)