summaryrefslogtreecommitdiffstats
path: root/source3/include/libsmbclient.h
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-02-13 10:58:54 -0800
committerTim Prouty <tprouty@samba.org>2009-02-13 12:59:30 -0800
commit5e5d2b2cfadaf3bf352dcc25b302b12c70803d1f (patch)
tree39f83635cfb3d959f7780ef334dbb8223c54e10f /source3/include/libsmbclient.h
parent6085ba3dec4fa616fca78c55b793cfd89ef272a8 (diff)
downloadsamba-5e5d2b2cfadaf3bf352dcc25b302b12c70803d1f.tar.gz
samba-5e5d2b2cfadaf3bf352dcc25b302b12c70803d1f.tar.xz
samba-5e5d2b2cfadaf3bf352dcc25b302b12c70803d1f.zip
s3 libsmbclient: Fix fstatvfs to be more portable
The statvfs struct isn't guaranteed to be portable across operating systems. Since libsmbclient isn't actually calling statvfs and just using the statvfs struct to store similar information, this patch adds a new portable smbc_statvfs struct. This fixes a few of the failures in the build farm introduced by: ae259575c447e61665c8e7070c476914161b953f Derrell, please check.
Diffstat (limited to 'source3/include/libsmbclient.h')
-rw-r--r--source3/include/libsmbclient.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index d35d9de6eaf..3bea0897d1f 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -75,7 +75,6 @@ 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>
@@ -174,6 +173,22 @@ 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
@@ -872,13 +887,13 @@ void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn);
typedef int (*smbc_statvfs_fn)(SMBCCTX *c,
char *path,
- struct statvfs *st);
+ struct smbc_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 statvfs *st);
+ struct smbc_statvfs *st);
smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c);
void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn);
@@ -1640,7 +1655,7 @@ int smbc_fstat(int fd, struct stat *st);
*/
int
smbc_statvfs(char *url,
- struct statvfs *st);
+ struct smbc_statvfs *st);
/**@ingroup attribute
* Get file system information via an file descriptor.
@@ -1663,7 +1678,7 @@ smbc_statvfs(char *url,
*/
int
smbc_fstatvfs(int fd,
- struct statvfs *st);
+ struct smbc_statvfs *st);
/**@ingroup attribute