lkml.org 
[lkml]   [2011]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v1 1/2] syscalls: Add capset and capget
From
Date
Add the capset and capget system calls to klibc so that userland can
invoke them.

Signed-off-by: Mike Waychison <mikew@google.com>
---
usr/include/sys/capability.h | 10 ++++++++++
usr/klibc/SYSCALLS.def | 6 ++++++
usr/klibc/syscalls/syscommon.h | 1 +
3 files changed, 17 insertions(+), 0 deletions(-)
create mode 100644 usr/include/sys/capability.h

diff --git a/usr/include/sys/capability.h b/usr/include/sys/capability.h
new file mode 100644
index 0000000..84ad419
--- /dev/null
+++ b/usr/include/sys/capability.h
@@ -0,0 +1,10 @@
+#ifndef _SYS_CAPABILITY_H
+#define _SYS_CAPABILITY_H
+
+#include <klibc/extern.h>
+#include <linux/capability.h>
+
+__extern int capget(cap_user_header_t hdrp, cap_user_data_t datap);
+__extern int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
+
+#endif /* _SYS_CAPABILITY_H */
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index d3279c7..ee3ffa9 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -77,6 +77,12 @@ int setfsgid32,setfsgid::setfsgid(gid_t);
int setresuid32,setresuid::setresuid(int, uid_t, uid_t, uid_t);

/*
+ * POSIX Capabilities
+ */
+int capget(cap_user_header_t, cap_user_data_t);
+int capset(cap_user_header_t, cap_user_data_t);
+
+/*
* Filesystem-related system calls
*/
int mount(const char *, const char *, const char *, unsigned long, const void *);
diff --git a/usr/klibc/syscalls/syscommon.h b/usr/klibc/syscalls/syscommon.h
index 0acae12..78f8858 100644
--- a/usr/klibc/syscalls/syscommon.h
+++ b/usr/klibc/syscalls/syscommon.h
@@ -12,6 +12,7 @@

#include <poll.h>
#include <sched.h>
+#include <sys/capability.h>
#include <sys/dirent.h>
#include <sys/klog.h>
#include <sys/mman.h>


\
 
 \ /
  Last update: 2011-07-19 22:41    [W:0.073 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site