summaryrefslogtreecommitdiff
path: root/source3/include/libsmbclient.h
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-12 10:39:17 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-12 10:39:48 -0500
commitae259575c447e61665c8e7070c476914161b953f (patch)
tree4193eb1193c1b3e7625cd01fda6f742d896635e1 /source3/include/libsmbclient.h
parent082ba6a1ad3a68aff118d96f855a2aa65eaeb359 (diff)
downloadsamba-ae259575c447e61665c8e7070c476914161b953f.tar.gz
samba-ae259575c447e61665c8e7070c476914161b953f.tar.bz2
samba-ae259575c447e61665c8e7070c476914161b953f.zip
[Bug 6069] Add a fstatvfs function for libsmbclient
- port functionality from v3_3_test to master Derrell
Diffstat (limited to 'source3/include/libsmbclient.h')
-rw-r--r--source3/include/libsmbclient.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index b2d9483a0b..d35d9de6ea 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>
@@ -174,6 +175,22 @@ typedef enum smbc_smb_encrypt_level
} smbc_smb_encrypt_level;
+/**
+ * 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
+ * available capabilities.
+ */
+typedef enum smbc_vfs_feature
+{
+ /* Defined by POSIX or in Linux include files (low-order bits) */
+ SMBC_VFS_FEATURE_RDONLY = (1 << 0),
+
+ /* Specific to libsmbclient (high-order bits) */
+ SMBC_VFS_FEATURE_DFS = (1 << 29),
+ SMBC_VFS_FEATURE_CASE_INSENSITIVE = (1 << 30),
+ SMBC_VFS_FEATURE_NO_UNIXCIFS = (1 << 31)
+} smbc_vfs_feature;
+
typedef int smbc_bool;
@@ -853,6 +870,18 @@ typedef int (*smbc_fstat_fn)(SMBCCTX *c,
smbc_fstat_fn smbc_getFunctionFstat(SMBCCTX *c);
void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn);
+typedef int (*smbc_statvfs_fn)(SMBCCTX *c,
+ char *path,
+ 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 statvfs *st);
+smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c);
+void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn);
+
typedef int (*smbc_ftruncate_fn)(SMBCCTX *c,
SMBCFILE *f,
off_t size);
@@ -1592,6 +1621,52 @@ int smbc_fstat(int fd, struct stat *st);
/**@ingroup attribute
+ * Get file system information for a specified path.
+ *
+ * @param url The smb url to get information for
+ *
+ * @param st pointer to a buffer that will be filled with
+ * standard Unix struct statvfs information.
+ *
+ * @return EBADF filedes is bad.
+ * - EACCES Permission denied.
+ * - EBADF fd is not a valid file descriptor
+ * - EINVAL Problems occurred in the underlying routines
+ * or smbc_init not called.
+ * - ENOMEM Out of memory
+ *
+ * @see Unix fstatvfs()
+ *
+ */
+int
+smbc_statvfs(char *url,
+ struct statvfs *st);
+
+/**@ingroup attribute
+ * Get file system information via an file descriptor.
+ *
+ * @param fd Open file handle from smbc_open(), smbc_creat(),
+ * or smbc_opendir()
+ *
+ * @param st pointer to a buffer that will be filled with
+ * standard Unix struct statvfs information.
+ *
+ * @return EBADF filedes is bad.
+ * - EACCES Permission denied.
+ * - EBADF fd is not a valid file descriptor
+ * - EINVAL Problems occurred in the underlying routines
+ * or smbc_init not called.
+ * - ENOMEM Out of memory
+ *
+ * @see Unix fstatvfs()
+ *
+ */
+int
+smbc_fstatvfs(int fd,
+ struct statvfs *st);
+
+
+/**@ingroup attribute
* Truncate a file given a file descriptor
*
* @param fd Open file handle from smbc_open() or smbc_creat()