summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-25 18:24:51 -0700
committerAndroid Code Review <code-review@android.com>2011-05-25 18:24:51 -0700
commit2cae7967e6049e45eaef71207481b6f8b2456025 (patch)
tree1ac7f16815e2d28ebbfdd474c8647beac6fbf3a5
parentb2c7e0c18b7ab04cfe306277c79165de0612a2d1 (diff)
parentb083bb57f5cae6b1fa3fd756a2720a3de806da2b (diff)
downloadbionic-2cae7967e6049e45eaef71207481b6f8b2456025.zip
bionic-2cae7967e6049e45eaef71207481b6f8b2456025.tar.gz
bionic-2cae7967e6049e45eaef71207481b6f8b2456025.tar.bz2
Merge "libc: Fix prctl() declaration."
-rw-r--r--libc/SYSCALLS.TXT2
-rw-r--r--libc/include/sys/prctl.h9
-rw-r--r--libc/include/unistd.h5
3 files changed, 12 insertions, 4 deletions
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 5653c3c..356f69b 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -76,6 +76,8 @@ int setpgid(pid_t, pid_t) 57
pid_t vfork(void) 190,-1,190
int setregid:setregid32(gid_t, gid_t) 204
int chroot(const char *) 61
+# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
+# to match the kernel implementation.
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
int capget(cap_user_header_t header, cap_user_data_t data) 184
int capset(cap_user_header_t header, const cap_user_data_t data) 185
diff --git a/libc/include/sys/prctl.h b/libc/include/sys/prctl.h
index ce85bf7..359d684 100644
--- a/libc/include/sys/prctl.h
+++ b/libc/include/sys/prctl.h
@@ -32,8 +32,13 @@
__BEGIN_DECLS
-extern int prctl(int option, unsigned long arg2, unsigned long arg3 , unsigned
- long arg4, unsigned long arg5);
+/* IMPORTANT NOTE: This function is declared as taking a variable number
+ * of arguments to match the GLibc definition. However
+ * its declaration inside SYSCALLS.TXT *must* make it
+ * take 6 arguments to ensure consistency with the kernel
+ * implementation.
+ */
+extern int prctl(int option, ...);
__END_DECLS
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 4534fb9..d92549f 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -70,8 +70,9 @@ extern int execlp(const char *, const char *, ...);
extern int execle(const char *, const char *, ...);
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);
-extern int prctl(int option, unsigned long arg2, unsigned long arg3,
- unsigned long arg4, unsigned long arg5);
+
+/* IMPORTANT: See comment under <sys/prctl.h> about this declaration */
+extern int prctl(int option, ...);
extern int nice(int);