diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 61dc95e..5d9b09d 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -199,8 +199,10 @@ struct SMBC_internal_data { smbc_stat_fn stat_fn; smbc_fstat_fn fstat_fn; #endif +#ifdef HAVE_SYS_STATVFS_H smbc_statvfs_fn statvfs_fn; smbc_fstatvfs_fn fstatvfs_fn; +#endif /* HAVE_SYS_STATVFS_H */ smbc_ftruncate_fn ftruncate_fn; #if 0 /* Left in libsmbclient.h for backward compatibility */ smbc_close_fn close_fn; @@ -505,6 +507,7 @@ SMBC_fstat_ctx(SMBCCTX *context, struct stat *st); +#ifdef HAVE_SYS_STATVFS_H int SMBC_statvfs_ctx(SMBCCTX *context, char *path, @@ -515,6 +518,7 @@ int SMBC_fstatvfs_ctx(SMBCCTX *context, SMBCFILE *file, struct statvfs *st); +#endif /* HAVE_SYS_STATVFS_H */ /* Functions in libsmb_xattr.c */ diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index ccf80da..6413f70 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -75,7 +75,9 @@ extern "C" { /* Make sure we have the following includes for now ... */ #include #include +#ifdef HAVE_SYS_STATVFS_H #include +#endif /* HAVE_SYS_STATVFS_H */ #include #include @@ -175,6 +177,7 @@ typedef enum smbc_smb_encrypt_level } smbc_smb_encrypt_level; +#ifdef HAVE_SYS_STATVFS_H /** * Capabilities set in the f_flag field of struct statvfs, from * smbc_statvfs(). These may be OR-ed together to reflect a full set of @@ -190,6 +193,7 @@ typedef enum smbc_vfs_feature SMBC_VFS_FEATURE_CASE_INSENSITIVE = (1 << 29), SMBC_VFS_FEATURE_NO_UNIXCIFS = (1 << 30) } smbc_vfs_feature; +#endif /* HAVE_SYS_STATVFS_H */ typedef int smbc_bool; @@ -881,6 +885,7 @@ typedef int (*smbc_fstat_fn)(SMBCCTX *c, smbc_fstat_fn smbc_getFunctionFstat(SMBCCTX *c); void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn); +#ifdef HAVE_SYS_STATVFS_H typedef int (*smbc_statvfs_fn)(SMBCCTX *c, char *path, struct statvfs *st); @@ -892,6 +897,7 @@ typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c, struct statvfs *st); smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c); void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn); +#endif /* HAVE_SYS_STATVFS_H */ typedef int (*smbc_ftruncate_fn)(SMBCCTX *c, SMBCFILE *f, @@ -1634,6 +1640,7 @@ int smbc_stat(const char *url, struct stat *st); int smbc_fstat(int fd, struct stat *st); +#ifdef HAVE_SYS_STATVFS_H /**@ingroup attribute * Get file system information for a specified path. * @@ -1680,7 +1687,7 @@ smbc_statvfs(char *url, int smbc_fstatvfs(int fd, struct statvfs *st); - +#endif /* HAVE_SYS_STATVFS_H */ /**@ingroup attribute * Truncate a file given a file descriptor diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c index 5b2ef2d..3994bf2 100644 --- a/source3/libsmb/libsmb_compat.c +++ b/source3/libsmb/libsmb_compat.c @@ -328,6 +328,7 @@ smbc_fstat(int fd, return smbc_getFunctionFstat(statcont)(statcont, file, st); } +#ifdef HAVE_SYS_STATVFS_H int smbc_statvfs(char *path, struct statvfs *st) @@ -342,6 +343,7 @@ smbc_fstatvfs(int fd, SMBCFILE * file = find_fd(fd); return smbc_getFunctionFstatVFS(statcont)(statcont, file, st); } +#endif /* HAVE_SYS_STATVFS_H */ int smbc_ftruncate(int fd, diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index 6c20d65..b3079c7 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -199,8 +199,10 @@ smbc_new_context(void) smbc_setFunctionLseek(context, SMBC_lseek_ctx); smbc_setFunctionFtruncate(context, SMBC_ftruncate_ctx); smbc_setFunctionStat(context, SMBC_stat_ctx); +#ifdef HAVE_SYS_STATVFS_H smbc_setFunctionStatVFS(context, SMBC_statvfs_ctx); smbc_setFunctionFstatVFS(context, SMBC_fstatvfs_ctx); +#endif /* HAVE_SYS_STATVFS_H */ smbc_setFunctionFstat(context, SMBC_fstat_ctx); smbc_setFunctionOpendir(context, SMBC_opendir_ctx); smbc_setFunctionClosedir(context, SMBC_closedir_ctx); diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c index 0a02346..4cdf70b 100644 --- a/source3/libsmb/libsmb_setget.c +++ b/source3/libsmb/libsmb_setget.c @@ -705,6 +705,7 @@ smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn) c->fstat = fn; } +#ifdef HAVE_SYS_STATVFS_H smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c) { @@ -722,6 +723,7 @@ smbc_getFunctionFstatVFS(SMBCCTX *c) { return c->internal->posix_emu.fstatvfs_fn; } +#endif /* HAVE_SYS_STATVFS_H */ void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn) diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index 426ace9..ef8ec39 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -294,6 +294,7 @@ SMBC_fstat_ctx(SMBCCTX *context, } +#ifdef HAVE_SYS_STATVFS_H /* * Routine to obtain file system information given a path */ @@ -475,3 +476,4 @@ SMBC_fstatvfs_ctx(SMBCCTX *context, return 0; } +#endif /* HAVE_SYS_STATVFS_H */