summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/utils/syncdaemon/libcxattr.py
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-08-10 05:02:43 +0300
committerAnand Avati <avati@gluster.com>2011-09-08 00:06:57 -0700
commit7d4560cbcdcae0d74cf486c544d5eb58775da51f (patch)
tree52a2a9cb4e51a4786b195492de18a1fb7b6713d2 /xlators/features/marker/utils/syncdaemon/libcxattr.py
parentd39a7fad09a6b4abcb23d132fd7dfdf0d440e928 (diff)
gsyncd: do the homework, document _everything_
Change-Id: I559e6a0709b8064cfd54c693e289c741f9c4c4ab BUG: 1570 Reviewed-on: http://review.gluster.com/319 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushik BV <kaushikbv@gluster.com>
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/libcxattr.py')
-rw-r--r--xlators/features/marker/utils/syncdaemon/libcxattr.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/libcxattr.py b/xlators/features/marker/utils/syncdaemon/libcxattr.py
index fdc016c47..f0a9d2292 100644
--- a/xlators/features/marker/utils/syncdaemon/libcxattr.py
+++ b/xlators/features/marker/utils/syncdaemon/libcxattr.py
@@ -3,6 +3,15 @@ from ctypes import *
from ctypes.util import find_library
class Xattr(object):
+ """singleton that wraps the extended attribues system
+ interface for python using ctypes
+
+ Just implement it to the degree we need it, in particular
+ - we need just the l*xattr variants, ie. we never want symlinks to be
+ followed
+ - don't need size discovery for getxattr, as we always know the exact
+ sizes we expect
+ """
libc = CDLL(find_library("libc"))
@@ -54,6 +63,7 @@ class Xattr(object):
@classmethod
def llistxattr_buf(cls, path):
+ """listxattr variant with size discovery"""
size = cls.llistxattr(path)
if size == -1:
cls.raise_oserr()