mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: [PATCH 3/10] xattr syscalls
Date: Sun, 22 Jul 2012 18:21:48 -0700	[thread overview]
Message-ID: <20120722182148.3a2fb735@newbook> (raw)
In-Reply-To: <20120722181332.191d4fa5@newbook>

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

On Sun, 22 Jul 2012 18:13:32 -0700
Isaac Dunham <idunham@lavabit.com> wrote:

> This patch series is basically a reworked version of orc's previous
> patch.
> From what orc said, the first patch should provide enough to build
> Xorg; I haven't tested this yet.
> A few more patches are syscall wrappers (splice) or trivial
> functions (finite).

Here's support for the xattr syscalls. orc probably knows better than I
what these are needed for...

Isaac Dunham

[-- Attachment #2: 3-xattr.diff --]
[-- Type: text/x-patch, Size: 2420 bytes --]

diff --git a/include/sys/xattr.h b/include/sys/xattr.h
new file mode 100644
index 0000000..0599cb3
--- /dev/null
+++ b/include/sys/xattr.h
@@ -0,0 +1,11 @@
+#define XATTR_CREATE 1
+#define XATTR_REPLACE 2
+ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
+ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
+ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size)
+ssize_t listxattr(const char *path, char *list, size_t size)
+ssize_t llistxattr(const char *path, char *list, size_t size)
+ssize_t flistxattr(int filedes, char *list, size_t size)
+int setxattr(const char *path, const char *name, const void *value, size_t size, int flags)
+int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags)
+int fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags)
diff --git a/src/linux/xattr.c b/src/linux/xattr.c
new file mode 100644
index 0000000..75b5015
--- /dev/null
+++ b/src/linux/xattr.c
@@ -0,0 +1,48 @@
+#include <sys/types.h>
+#include <sys/xattr.h>
+#include "syscall.h"
+
+ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
+{
+	return syscall(SYS_getxattr, path, name, value, size);
+}
+
+ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
+{
+	return syscall(SYS_lgetxattr, path, name, value, size);
+}
+
+ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size)
+{
+	return syscall(SYS_fgetxattr, filedes, name, value, size);
+}
+
+ssize_t listxattr(const char *path, char *list, size_t size)
+{
+	return syscall(SYS_listxattr, path, list, size);
+}
+
+ssize_t llistxattr(const char *path, char *list, size_t size)
+{
+	return syscall(SYS_llistxattr, path, list, size);
+}
+
+ssize_t flistxattr(int filedes, char *list, size_t size)
+{
+	return syscall(SYS_flistxattr, filedes, list, size);
+}
+
+int setxattr(const char *path, const char *name, const void *value, size_t size, int flags)
+{
+	return syscall(SYS_setxattr, path, name, value, size, flags);
+}
+
+int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags)
+{
+	return syscall(SYS_lsetxattr, path, name, value, size, flags);
+}
+
+int fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags)
+{
+	return syscall(SYS_fsetxattr, filedes, name, value, size, flags);
+}

  parent reply	other threads:[~2012-07-23  1:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23  1:13 [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-07-23  1:17 ` [PATCH 2/10] splice Isaac Dunham
2012-07-23  1:21 ` Isaac Dunham [this message]
2012-07-24 18:06   ` [PATCH 3/10] xattr syscalls orc
2012-07-23  1:24 ` [PATCH 4/10] pipe2 Isaac Dunham
2012-07-23  1:28 ` [PATCH 5/10] __sigsetjmp alias Isaac Dunham
2012-07-23  1:32 ` [PATCH 6/10] Provide private versions of locale/ functions Isaac Dunham
2012-07-23  1:33 ` [PATCH 7/10] __fcntl Isaac Dunham
2012-07-23  1:36 ` [PATCH 8/10] finite Isaac Dunham
2012-07-23  7:58   ` Szabolcs Nagy
2012-07-23  1:38 ` [PATCH 9/10] GLIBC ABI patches Isaac Dunham
2012-07-23 15:11   ` Arvid E. Picciani
2012-07-24 18:15     ` Igmar Palsenberg
2012-07-24 18:19       ` Gregor Richards
2012-07-24 18:23         ` Igmar Palsenberg
2012-07-24 18:29           ` Gregor Richards
2012-07-24 18:33             ` Igmar Palsenberg
2012-07-24 23:18               ` Rich Felker
2012-07-25  7:27               ` Arvid E. Picciani
2012-07-25 14:12   ` Luca Barbato
2012-07-25 15:19     ` Rich Felker
2012-07-25 15:52       ` Luca Barbato
2012-07-25 17:35         ` Rich Felker
2012-07-25 23:06       ` idunham
2012-07-23  1:40 ` [PATCH 10/10] More glibc ABI compatability Isaac Dunham
2012-08-07  2:22 ` [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-08-07  3:29   ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120722182148.3a2fb735@newbook \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).