Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5b97dde514f9bd43f9e525451d0a863c4fc8a9a
Commit:     e5b97dde514f9bd43f9e525451d0a863c4fc8a9a
Parent:     b6558c4a2378af06f2beca6c8a3304e21d1cf135
Author:     Roland McGrath <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 26 00:56:48 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jan 26 13:50:58 2007 -0800

    [PATCH] Add VM_ALWAYSDUMP
    
    This patch adds the VM_ALWAYSDUMP flag for vm_flags in vm_area_struct.  This
    provides a clean explicit way to have a vma always included in core dumps, 
as
    is needed for vDSO's.
    
    Signed-off-by: Roland McGrath <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Paul Mackerras <[EMAIL PROTECTED]>
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/binfmt_elf.c    |    4 ++++
 include/linux/mm.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 7cb2872..6fec8bf 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1178,6 +1178,10 @@ static int dump_seek(struct file *file, loff_t off)
  */
 static int maydump(struct vm_area_struct *vma)
 {
+       /* The vma can be set up to tell us the answer directly.  */
+       if (vma->vm_flags & VM_ALWAYSDUMP)
+               return 1;
+
        /* Do not dump I/O mapped devices or special mappings */
        if (vma->vm_flags & (VM_IO | VM_RESERVED))
                return 0;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7691223..2d2c08d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -168,6 +168,7 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_NONLINEAR   0x00800000      /* Is non-linear (remap_file_pages) */
 #define VM_MAPPED_COPY 0x01000000      /* T if mapped copy of data (nommu 
mmap) */
 #define VM_INSERTPAGE  0x02000000      /* The vma has had "vm_insert_page()" 
done on it */
+#define VM_ALWAYSDUMP  0x04000000      /* Always include in core dumps */
 
 #ifndef VM_STACK_DEFAULT_FLAGS         /* arch can override this */
 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to