2 #include <sys/statvfs.h>
8 #include <libsmbclient.h>
9 #include "get_auth_data_fn.h"
12 int main(int argc
, char * argv
[])
18 struct statvfs statvfsbuf
;
20 smbc_init(get_auth_data_fn
, debug
);
24 fprintf(stdout
, "Path: ");
26 p
= fgets(path
, sizeof(path
) - 1, stdin
);
28 fprintf(stderr
, "failed to read from stdin\n");
31 if (strlen(path
) == 0)
36 p
= path
+ strlen(path
) - 1;
42 ret
= smbc_statvfs(path
, &statvfsbuf
);
51 printf("Block Size: %lu\n", statvfsbuf
.f_bsize
);
52 printf("Fragment Size: %lu\n", statvfsbuf
.f_frsize
);
53 printf("Blocks: %llu\n",
54 (unsigned long long) statvfsbuf
.f_blocks
);
55 printf("Free Blocks: %llu\n",
56 (unsigned long long) statvfsbuf
.f_bfree
);
57 printf("Available Blocks: %llu\n",
58 (unsigned long long) statvfsbuf
.f_bavail
);
59 printf("Files : %llu\n",
60 (unsigned long long) statvfsbuf
.f_files
);
61 printf("Free Files: %llu\n",
62 (unsigned long long) statvfsbuf
.f_ffree
);
63 printf("Available Files: %llu\n",
64 (unsigned long long) statvfsbuf
.f_favail
);
66 printf("File System ID: %lu\n",
67 (unsigned long) statvfsbuf
.f_fsid
);
71 printf("Flags: 0x%lx\n", statvfsbuf
.f_flag
);
72 printf("Extended Features: ");
74 if (statvfsbuf
.f_flag
& SMBC_VFS_FEATURE_NO_UNIXCIFS
)
76 printf("NO_UNIXCIFS ");
83 if (statvfsbuf
.f_flag
& SMBC_VFS_FEATURE_CASE_INSENSITIVE
)
85 printf("CASE_INSENSITIVE ");
89 printf("case_sensitive ");
92 if (statvfsbuf
.f_flag
& SMBC_VFS_FEATURE_DFS
)