From ddbd7b570d0a9f599b417a499c912c5b13a003c9 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Sun, 14 Jun 2015 23:57:42 +0530 Subject: Add missing Path based operation APIs * Added commonly used path based operations that were missing from the Volume class. * Fixed function prototypes at places where it should be ssize_t and not size_t. This caused overflow error at times. * Added doc strings wherever they were missing. Change-Id: I6ce28038da3cd0f89ab075045bb4092dd95e21c4 Signed-off-by: Prashanth Pai --- gluster/api.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'gluster/api.py') diff --git a/gluster/api.py b/gluster/api.py index 560ede8..62135c5 100755 --- a/gluster/api.py +++ b/gluster/api.py @@ -320,26 +320,26 @@ glfs_fsync = ctypes.CFUNCTYPE( glfs_lseek = ctypes.CFUNCTYPE(ctypes.c_ulong, ctypes.c_void_p, ctypes.c_ulong, ctypes.c_int)(('glfs_lseek', client)) -glfs_read = ctypes.CFUNCTYPE(ctypes.c_size_t, +glfs_read = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_int)(('glfs_read', client)) -glfs_write = ctypes.CFUNCTYPE(ctypes.c_size_t, +glfs_write = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_int)(('glfs_write', client)) -glfs_getxattr = ctypes.CFUNCTYPE(ctypes.c_size_t, +glfs_getxattr = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_void_p, ctypes.c_size_t)(('glfs_getxattr', client)) -glfs_listxattr = ctypes.CFUNCTYPE(ctypes.c_size_t, +glfs_listxattr = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_void_p, @@ -423,6 +423,25 @@ glfs_flistxattr = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_size_t)(('glfs_flistxattr', client)) +glfs_access = ctypes.CFUNCTYPE(ctypes.c_int, + ctypes.c_void_p, + ctypes.c_char_p, + ctypes.c_int)(('glfs_access', client)) + +glfs_readlink = ctypes.CFUNCTYPE(ctypes.c_int, + ctypes.c_void_p, + ctypes.c_char_p, + ctypes.c_char_p, + ctypes.c_size_t)(('glfs_readlink', client)) + +glfs_chdir = ctypes.CFUNCTYPE(ctypes.c_int, + ctypes.c_void_p, + ctypes.c_char_p)(('glfs_chdir', client)) + +glfs_getcwd = ctypes.CFUNCTYPE(ctypes.c_char_p, + ctypes.c_void_p, + ctypes.c_char_p, + ctypes.c_size_t)(('glfs_getcwd', client)) # TODO: creat and open fails on test_create_file_already_exists & test_open_file_not_exist functional testing, # noqa -- cgit