PATCH: Define auxiliary vector size, AT_VECTOR_SIZE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The size of auxiliary vector is fixed at 42 in linux/sched.h. But
it isn't very obvious when looking at linux/elf.h. This patch adds
AT_VECTOR_SIZE so that we can change it if necessary when a new
vector is added.


H.J.
--- linux/include/linux/elf.h.auxv	2004-10-18 14:53:22.000000000 -0700
+++ linux/include/linux/elf.h	2005-07-26 10:39:26.000000000 -0700
@@ -178,6 +178,8 @@ typedef __s64	Elf64_Sxword;
 
 #define AT_SECURE 23   /* secure mode boolean */
 
+#define AT_VECTOR_SIZE  42 /* Size of auxiliary table.  */
+
 typedef struct dynamic{
   Elf32_Sword d_tag;
   union{
--- linux/include/linux/sched.h.auxv	2005-07-19 09:01:33.000000000 -0700
+++ linux/include/linux/sched.h	2005-07-26 10:41:08.000000000 -0700
@@ -30,6 +30,8 @@
 #include <linux/pid.h>
 #include <linux/percpu.h>
 
+#include <linux/elf.h>	/* For AT_VECTOR_SIZE */
+
 struct exec_domain;
 extern int exec_shield;
 extern int exec_shield_randomize;
@@ -238,7 +240,7 @@ struct mm_struct {
 	unsigned long rss, anon_rss, total_vm, locked_vm, shared_vm;
 	unsigned long exec_vm, stack_vm, reserved_vm, def_flags;
 
-	unsigned long saved_auxv[42]; /* for /proc/PID/auxv */
+	unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
 
 	unsigned dumpable:2;
 	cpumask_t cpu_vm_mask;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux