summaryrefslogtreecommitdiff
path: root/_obnammodule.c
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-12-02 21:50:11 +0000
committerLars Wirzenius <liw@liw.fi>2011-12-02 21:50:11 +0000
commita5e478ba8d620fde36008ae7db1bb6699c779a25 (patch)
treee3b0887f522e5d1517711cf626a52ae14ef5b4ad /_obnammodule.c
parente4b3fbe16e44403b80ecc2e01732cbbbc9c47929 (diff)
downloadobnam-a5e478ba8d620fde36008ae7db1bb6699c779a25.tar.gz
add lsetxattr wrapper
Diffstat (limited to '_obnammodule.c')
-rw-r--r--_obnammodule.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/_obnammodule.c b/_obnammodule.c
index f124b394..c2d8b5e4 100644
--- a/_obnammodule.c
+++ b/_obnammodule.c
@@ -185,7 +185,19 @@ lgetxattr_wrapper(PyObject *self, PyObject *args)
static PyObject *
lsetxattr_wrapper(PyObject *self, PyObject *args)
{
- return NULL;
+ const char *filename;
+ const char *name;
+ const char *value;
+ int size;
+ int ret;
+
+ if (!PyArg_ParseTuple(args, "sss#", &filename, &name, &value, &size))
+ return NULL;
+
+ ret = lsetxattr(filename, name, value, size, 0);
+ if (ret == -1)
+ ret = errno;
+ return Py_BuildValue("i", ret);
}