Browse Source

add missing xattr functions

not sure why these were originally omitted..
Rich Felker 12 years ago
parent
commit
7650390de8
2 changed files with 18 additions and 0 deletions
  1. 3 0
      include/sys/xattr.h
  2. 15 0
      src/linux/xattr.c

+ 3 - 0
include/sys/xattr.h

@@ -20,6 +20,9 @@ ssize_t flistxattr(int filedes, char *, size_t);
 int setxattr(const char *, const char *, const void *, size_t, int);
 int lsetxattr(const char *, const char *, const void *, size_t, int);
 int fsetxattr(int, const char *, const void *, size_t, int);
+int removexattr(const char *, const char *);
+int lremovexattr(const char *, const char *);
+int fremovexattr(int, const char *);
 
 #ifdef __cplusplus
 }

+ 15 - 0
src/linux/xattr.c

@@ -45,3 +45,18 @@ int fsetxattr(int filedes, const char *name, const void *value, size_t size, int
 {
 	return syscall(SYS_fsetxattr, filedes, name, value, size, flags);
 }
+
+int removexattr(const char *path, const char *name)
+{
+	return syscall(SYS_removexattr, path, name);
+}
+
+int lremovexattr(const char *path, const char *name)
+{
+	return syscall(SYS_lremovexattr, path, name);
+}
+
+int fremovexattr(int fd, const char *name)
+{
+	return syscall(SYS_fremovexattr, fd, name);
+}