1libssh2_sftp_statvfs(3) libssh2 manual 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
37
39 LIBSSH2_SFTP_STATVFS is a typedefed struct that is defined as below
40
41 struct _LIBSSH2_SFTP_STATVFS {
42 libssh2_uint64_t f_bsize; /* file system block size */
43 libssh2_uint64_t f_frsize; /* fragment size */
44 libssh2_uint64_t f_blocks; /* size of fs in f_frsize units */
45 libssh2_uint64_t f_bfree; /* # free blocks */
46 libssh2_uint64_t f_bavail; /* # free blocks for non-root */
47 libssh2_uint64_t f_files; /* # inodes */
48 libssh2_uint64_t f_ffree; /* # free inodes */
49 libssh2_uint64_t f_favail; /* # free inodes for non-root */
50 libssh2_uint64_t f_fsid; /* file system ID */
51 libssh2_uint64_t f_flag; /* mount flags */
52 libssh2_uint64_t f_namemax; /* maximum filename length */
53 };
54
55 It is unspecified whether all members of the returned struct have mean‐
56 ingful values on all file systems.
57
58 The field f_flag is a bit mask. Bits are defined as follows:
59
60 LIBSSH2_SFTP_ST_RDONLY
61 Read-only file system.
62
63 LIBSSH2_SFTP_ST_NOSUID
64 Set-user-ID/set-group-ID bits are ignored by exec(3).
65
66
68 Returns 0 on success or negative on failure. If used in non-blocking
69 mode, it returns LIBSSH2_ERROR_EAGAIN when it would otherwise block.
70 While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a
71 failure per se.
72
74 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
75
76 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
77
78 LIBSSH2_ERROR_SOCKET_TIMEOUT -
79
80 LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was
81 received on the socket, or an SFTP operation caused an errorcode to be
82 returned by the server.
83
85 Added in libssh2 1.2.6
86
88 libssh2_sftp_open_ex(3)
89
90
91
92libssh2 1.2.6 22 May 2010 libssh2_sftp_statvfs(3)