From f71c1cdb55eab4203036ac33b0269d90d2216cc2 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 20 Aug 2011 18:55:45 +0000 Subject: * fhandler_process.cc (format_process_maps): Define page protection shortcuts RO, X, and WC. Use in creating access flag string. Don't set type flag to 's' for copy-on-write pages, as on Linux. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_process.cc | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3cabade..30e1df4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-08-20 Corinna Vinschen + + * fhandler_process.cc (format_process_maps): Define page protection + shortcuts RO, X, and WC. Use in creating access flag string. Don't + set type flag to 's' for copy-on-write pages, as on Linux. + 2011-08-19 Yaakov Selkowitz * devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR, diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 36270d1..91e2286 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -907,16 +907,19 @@ format_process_maps (void *data, char *&destbuf) } else { + static DWORD const RO = (PAGE_EXECUTE_READ | PAGE_READONLY); static DWORD const RW = (PAGE_EXECUTE_READWRITE | PAGE_READWRITE | PAGE_EXECUTE_WRITECOPY | PAGE_WRITECOPY); + static DWORD const X = (PAGE_EXECUTE | PAGE_EXECUTE_READ + | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY); + static DWORD const WC = (PAGE_EXECUTE_WRITECOPY | PAGE_WRITECOPY); DWORD p = mb.Protect; a = (access) {{ - (p & (RW | PAGE_EXECUTE_READ | PAGE_READONLY)) ? 'r' : '-', - (p & (RW)) ? 'w' : '-', - (p & (PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_READ - | PAGE_EXECUTE_WRITECOPY | PAGE_EXECUTE)) ? 'x' : '-', - (mb.Type & MEM_MAPPED) ? 's' - : (p & PAGE_GUARD) ? 'g' : 'p', + (p & (RO | RW)) ? 'r' : '-', + (p & (RW)) ? 'w' : '-', + (p & (X)) ? 'x' : '-', + (mb.Type & MEM_MAPPED) && !(p & (WC)) ? 's' + : (p & PAGE_GUARD) ? 'g' : 'p', '\0', // zero-fill the remaining bytes }}; } -- cgit v1.1