diff options
author | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2009-02-13 16:47:54 -0500 |
---|---|---|
committer | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2009-02-14 09:44:36 -0500 |
commit | 352c97561e9de6ccd0102859d18ed15913042622 (patch) | |
tree | 3959fae8277a9218bac8d70a57a9f77638852a2b | |
parent | 1c9630bf4df4315e0c7b72ac126c43b49f499834 (diff) | |
download | samba-352c97561e9de6ccd0102859d18ed15913042622.tar.gz |
[Bug 6069] Add a fstatvfs function for libsmbclient
- Revert Tim's changes for the moment. I need to see what the issue is and
arrange to use "struct statvfs" if at all possible.
Derrell
-rw-r--r-- | examples/libsmbclient/testfstatvfs.c | 3 | ||||
-rw-r--r-- | examples/libsmbclient/teststatvfs.c | 3 | ||||
-rw-r--r-- | source3/include/libsmb_internal.h | 4 | ||||
-rw-r--r-- | source3/include/libsmbclient.h | 25 | ||||
-rw-r--r-- | source3/libsmb/libsmb_compat.c | 4 | ||||
-rw-r--r-- | source3/libsmb/libsmb_stat.c | 4 |
6 files changed, 15 insertions, 28 deletions
diff --git a/examples/libsmbclient/testfstatvfs.c b/examples/libsmbclient/testfstatvfs.c index 815afac8665..b4dafefff60 100644 --- a/examples/libsmbclient/testfstatvfs.c +++ b/examples/libsmbclient/testfstatvfs.c @@ -1,4 +1,5 @@ #include <sys/types.h> +#include <sys/statvfs.h> #include <stdio.h> #include <unistd.h> #include <string.h> @@ -17,7 +18,7 @@ int main(int argc, char * argv[]) char * p; char path[2048]; struct stat statbuf; - struct smbc_statvfs statvfsbuf; + struct statvfs statvfsbuf; smbc_init(get_auth_data_fn, debug); diff --git a/examples/libsmbclient/teststatvfs.c b/examples/libsmbclient/teststatvfs.c index b9509d2e07a..8812002d5ce 100644 --- a/examples/libsmbclient/teststatvfs.c +++ b/examples/libsmbclient/teststatvfs.c @@ -1,4 +1,5 @@ #include <sys/types.h> +#include <sys/statvfs.h> #include <stdio.h> #include <unistd.h> #include <string.h> @@ -17,7 +18,7 @@ int main(int argc, char * argv[]) char * p; char path[2048]; struct stat statbuf; - struct smbc_statvfs statvfsbuf; + struct statvfs statvfsbuf; smbc_init(get_auth_data_fn, debug); diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index d3683eb3dc8..166685c3801 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -506,13 +506,13 @@ SMBC_fstat_ctx(SMBCCTX *context, int SMBC_statvfs_ctx(SMBCCTX *context, char *path, - struct smbc_statvfs *st); + struct statvfs *st); int SMBC_fstatvfs_ctx(SMBCCTX *context, SMBCFILE *file, - struct smbc_statvfs *st); + struct statvfs *st); /* Functions in libsmb_xattr.c */ diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 3bea0897d1f..d35d9de6eaf 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -75,6 +75,7 @@ extern "C" { /* Make sure we have the following includes for now ... */ #include <sys/types.h> #include <sys/stat.h> +#include <sys/statvfs.h> #include <fcntl.h> #include <utime.h> @@ -173,22 +174,6 @@ typedef enum smbc_smb_encrypt_level SMBC_ENCRYPTLEVEL_REQUIRE = 2 } smbc_smb_encrypt_level; -/** - * Use a system independent statvfs struct for smbclient. - */ -struct smbc_statvfs { - fsblkcnt_t f_bavail; - fsblkcnt_t f_bfree; - fsblkcnt_t f_blocks; - fsfilcnt_t f_favail; - fsfilcnt_t f_ffree; - fsfilcnt_t f_files; - unsigned long f_bsize; - unsigned long f_flag; - unsigned long f_frsize; - unsigned long f_fsid; - unsigned long f_namemax; -}; /** * Capabilities set in the f_flag field of struct statvfs, from @@ -887,13 +872,13 @@ void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn); typedef int (*smbc_statvfs_fn)(SMBCCTX *c, char *path, - struct smbc_statvfs *st); + struct statvfs *st); smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c); void smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn); typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c, SMBCFILE *file, - struct smbc_statvfs *st); + struct statvfs *st); smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c); void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn); @@ -1655,7 +1640,7 @@ int smbc_fstat(int fd, struct stat *st); */ int smbc_statvfs(char *url, - struct smbc_statvfs *st); + struct statvfs *st); /**@ingroup attribute * Get file system information via an file descriptor. @@ -1678,7 +1663,7 @@ smbc_statvfs(char *url, */ int smbc_fstatvfs(int fd, - struct smbc_statvfs *st); + struct statvfs *st); /**@ingroup attribute diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c index 95485dc1021..56d113f31a2 100644 --- a/source3/libsmb/libsmb_compat.c +++ b/source3/libsmb/libsmb_compat.c @@ -331,14 +331,14 @@ smbc_fstat(int fd, int smbc_statvfs(char *path, - struct smbc_statvfs *st) + struct statvfs *st) { return smbc_getFunctionStatVFS(statcont)(statcont, path, st); } int smbc_fstatvfs(int fd, - struct smbc_statvfs *st) + struct statvfs *st) { SMBCFILE * file = find_fd(fd); return smbc_getFunctionFstatVFS(statcont)(statcont, file, st); diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index 0ad40e878a9..d589f7ef712 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -308,7 +308,7 @@ SMBC_fstat_ctx(SMBCCTX *context, int SMBC_statvfs_ctx(SMBCCTX *context, char *path, - struct smbc_statvfs *st) + struct statvfs *st) { int ret; bool bIsDir; @@ -360,7 +360,7 @@ SMBC_statvfs_ctx(SMBCCTX *context, int SMBC_fstatvfs_ctx(SMBCCTX *context, SMBCFILE *file, - struct smbc_statvfs *st) + struct statvfs *st) { uint32 fs_attrs = 0; struct cli_state *cli = file->srv->cli; |