summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-02-26 21:44:51 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-02-26 21:44:51 -0500
commitfa341d526293f4d986f2f3d838a728ce4223ee88 (patch)
tree0a4a3e6d005ef1c15e8cce07d07f87fefa4200cd /source3/include
parent346c94972a0c603ecf8dd5690822c107dbeacc67 (diff)
downloadsamba-fa341d526293f4d986f2f3d838a728ce4223ee88.tar.gz
samba-fa341d526293f4d986f2f3d838a728ce4223ee88.tar.bz2
samba-fa341d526293f4d986f2f3d838a728ce4223ee88.zip
add smbc_ftruncate() to emulate POSIX ftruncate()
(This used to be commit 6f5051b9c1405ab1dc3e697419ceedb3acac46d8)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/libsmbclient.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index 07242f7956..64afc09499 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -427,6 +427,8 @@ struct _SMBCCTX {
off_t (*lseek) (SMBCCTX *c, SMBCFILE * file, off_t offset, int whence);
int (*stat) (SMBCCTX *c, const char *fname, struct stat *st);
int (*fstat) (SMBCCTX *c, SMBCFILE *file, struct stat *st);
+ /* ftruncate added near _internal for ABI compatibility */
+
int (*close_fn) (SMBCCTX *c, SMBCFILE *file);
/** callable functions for dirs
@@ -520,6 +522,12 @@ struct _SMBCCTX {
int flags;
/** user options selections that apply to this session
+ *
+ * NEW OPTIONS ARE NOT ADDED HERE!
+ *
+ * We must maintain ABI backward compatibility. We now use
+ * smbc_option_set() and smbc_option_get() for all newly added
+ * options.
*/
struct _smbc_options {
@@ -580,6 +588,9 @@ struct _SMBCCTX {
int one_share_per_server;
} options;
+ /* Add additional functions here for ABI backward compatibility */
+ int (*ftruncate)(SMBCCTX *c, SMBCFILE *f, off_t size);
+
/** INTERNAL DATA
* do _NOT_ touch this from your program !
*/
@@ -1193,6 +1204,26 @@ int smbc_stat(const char *url, struct stat *st);
int smbc_fstat(int fd, struct stat *st);
+/**@ingroup attribute
+ * Truncate a file given a file descriptor
+ *
+ * @param fd Open file handle from smbc_open() or smbc_creat()
+ *
+ * @param size size to truncate the file to
+ *
+ * @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 ftruncate()
+ *
+ */
+int smbc_ftruncate(int fd, off_t size);
+
+
/**@ingroup attribue
* Change the ownership of a file or directory.
*