acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Acl-devel] [attr PATCH 3/3] Reintroduce symbols that used to be syscall


From: Dmitry V. Levin
Subject: [Acl-devel] [attr PATCH 3/3] Reintroduce symbols that used to be syscall wrappers
Date: Tue, 15 Sep 2015 19:42:51 +0300

Commit 7921157890d07858d092f4003ca4c6bae9fd2c38 removed symbols
that were part of ABI.
Reintroduce these symbols to fix the ABI breakage.

These backward compatibility symbols just use xattr syscall wrappers
provided by libc.
---
 libattr/Makemodule.am |  6 ++++-
 libattr/libattr.lds   | 12 +++++++++
 libattr/syscalls.c    | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 libattr/libattr.lds
 create mode 100644 libattr/syscalls.c

diff --git a/libattr/Makemodule.am b/libattr/Makemodule.am
index a5a0cdd..4b3720c 100644
--- a/libattr/Makemodule.am
+++ b/libattr/Makemodule.am
@@ -8,15 +8,19 @@ LT_CURRENT = 2
 LT_AGE = 1
 LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
-libattr_la_DEPENDENCIES = exports
+libattr_la_DEPENDENCIES = exports libattr/libattr.lds
 libattr_la_SOURCES = \
        libattr/attr_copy_action.c \
        libattr/attr_copy_check.c \
        libattr/attr_copy_fd.c \
        libattr/attr_copy_file.c \
        libattr/libattr.c \
+       libattr/syscalls.c \
        libattr/libattr.h
 libattr_la_CFLAGS = -include libattr/libattr.h
 libattr_la_LDFLAGS = \
        -Wl,--version-script,$(top_srcdir)/exports \
+       -Wl,$(top_srcdir)/libattr/libattr.lds \
        -version-info $(LTVERSION)
+
+EXTRA_DIST += libattr/libattr.lds
diff --git a/libattr/libattr.lds b/libattr/libattr.lds
new file mode 100644
index 0000000..947f15d
--- /dev/null
+++ b/libattr/libattr.lds
@@ -0,0 +1,12 @@
+"address@hidden" = libattr_fgetxattr;
+"address@hidden" = libattr_flistxattr;
+"address@hidden" = libattr_fremovexattr;
+"address@hidden" = libattr_fsetxattr;
+"address@hidden" = libattr_getxattr;
+"address@hidden" = libattr_lgetxattr;
+"address@hidden" = libattr_listxattr;
+"address@hidden" = libattr_llistxattr;
+"address@hidden" = libattr_lremovexattr;
+"address@hidden" = libattr_lsetxattr;
+"address@hidden" = libattr_removexattr;
+"address@hidden" = libattr_setxattr;
diff --git a/libattr/syscalls.c b/libattr/syscalls.c
new file mode 100644
index 0000000..d9caf60
--- /dev/null
+++ b/libattr/syscalls.c
@@ -0,0 +1,67 @@
+#include <sys/xattr.h>
+
+int libattr_setxattr (const char *path, const char *name,
+                       void *value, size_t size, int flags)
+{
+       return setxattr(path, name, value, size, flags);
+}
+
+int libattr_lsetxattr (const char *path, const char *name,
+                       void *value, size_t size, int flags)
+{
+       return lsetxattr(path, name, value, size, flags);
+}
+
+int libattr_fsetxattr (int filedes, const char *name,
+                       void *value, size_t size, int flags)
+{
+       return fsetxattr(filedes, name, value, size, flags);
+}
+
+ssize_t libattr_getxattr (const char *path, const char *name,
+                       void *value, size_t size)
+{
+       return getxattr(path, name, value, size);
+}
+
+ssize_t libattr_lgetxattr (const char *path, const char *name,
+                       void *value, size_t size)
+{
+       return lgetxattr(path, name, value, size);
+}
+
+ssize_t libattr_fgetxattr (int filedes, const char *name,
+                       void *value, size_t size)
+{
+       return fgetxattr(filedes, name, value, size);
+}
+
+ssize_t libattr_listxattr (const char *path, char *list, size_t size)
+{
+       return listxattr(path, list, size);
+}
+
+ssize_t libattr_llistxattr (const char *path, char *list, size_t size)
+{
+       return llistxattr(path, list, size);
+}
+
+ssize_t libattr_flistxattr (int filedes, char *list, size_t size)
+{
+       return flistxattr(filedes, list, size);
+}
+
+int libattr_removexattr (const char *path, const char *name)
+{
+       return removexattr(path, name);
+}
+
+int libattr_lremovexattr (const char *path, const char *name)
+{
+       return lremovexattr(path, name);
+}
+
+int libattr_fremovexattr (int filedes, const char *name)
+{
+       return fremovexattr(filedes, name);
+}

-- 
ldv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]