summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2021-08-11 19:34:52 +0200
committerLinus Groh <mail@linusgroh.de>2021-08-14 22:32:00 +0100
commitf8d27303d06a646c6d0d3bc96ade61e1948bf880 (patch)
treea27d4692e21fc51695e1b02b3f8f68da3616ced0
parent04733ccb563bb3c556ee7ccb959c435eb69dd2fd (diff)
downloadserenity-f8d27303d06a646c6d0d3bc96ade61e1948bf880.zip
LibC: Add stubs for several functions in xattr.h
The following functions are stubbed out: - getxattr - lgetxattr - fgetxattr - setxattr - lsetxattr - fsetxattr - listxattr - llistxattr - flistxattr
-rw-r--r--Userland/Libraries/LibC/CMakeLists.txt1
-rw-r--r--Userland/Libraries/LibC/sys/xattr.cpp62
-rw-r--r--Userland/Libraries/LibC/sys/xattr.h25
3 files changed, 88 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt
index 0d701aa1b3..1022ec944c 100644
--- a/Userland/Libraries/LibC/CMakeLists.txt
+++ b/Userland/Libraries/LibC/CMakeLists.txt
@@ -51,6 +51,7 @@ set(LIBC_SOURCES
sys/uio.cpp
sys/wait.cpp
sys/statvfs.cpp
+ sys/xattr.cpp
termcap.cpp
termios.cpp
time.cpp
diff --git a/Userland/Libraries/LibC/sys/xattr.cpp b/Userland/Libraries/LibC/sys/xattr.cpp
new file mode 100644
index 0000000000..b52dcc0f14
--- /dev/null
+++ b/Userland/Libraries/LibC/sys/xattr.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <AK/Format.h>
+#include <sys/xattr.h>
+
+ssize_t getxattr(const char*, const char*, void*, size_t)
+{
+ dbgln("FIXME: Implement getxattr()");
+ return 0;
+}
+
+ssize_t lgetxattr(const char*, const char*, void*, size_t)
+{
+ dbgln("FIXME: Implement lgetxattr()");
+ return 0;
+}
+
+ssize_t fgetxattr(int, const char*, void*, size_t)
+{
+ dbgln("FIXME: Implement fgetxattr()");
+ return 0;
+}
+
+int setxattr(const char*, const char*, const void*, size_t, int)
+{
+ dbgln("FIXME: Implement setxattr()");
+ return 0;
+}
+
+int lsetxattr(const char*, const char*, const void*, size_t, int)
+{
+ dbgln("FIXME: Implement lsetxattr()");
+ return 0;
+}
+
+int fsetxattr(int, const char*, const void*, size_t, int)
+{
+ dbgln("FIXME: Implement fsetxattr()");
+ return 0;
+}
+
+ssize_t listxattr(const char*, char*, size_t)
+{
+ dbgln("FIXME: Implement listxattr()");
+ return 0;
+}
+
+ssize_t llistxattr(const char*, char*, size_t)
+{
+ dbgln("FIXME: Implement llistxattr()");
+ return 0;
+}
+
+ssize_t flistxattr(int, char*, size_t)
+{
+ dbgln("FIXME: Implement flistxattr()");
+ return 0;
+}
diff --git a/Userland/Libraries/LibC/sys/xattr.h b/Userland/Libraries/LibC/sys/xattr.h
new file mode 100644
index 0000000000..8855225efc
--- /dev/null
+++ b/Userland/Libraries/LibC/sys/xattr.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+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 fd, const char* name, void* value, 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 fd, const char* name, const void* value, size_t size, int flags);
+
+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 fd, char* list, size_t size);
+
+__END_DECLS