Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-08-20 22:55:45 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-08-20 22:55:45 +0400
commitf71c1cdb55eab4203036ac33b0269d90d2216cc2 (patch)
tree7f1a5ef5a0304bc4426af0db75f1f7467e9d06d6 /winsup/cygwin/fhandler_process.cc
parentfe9bdaedffbb26dfc4339908babc517cec0872b2 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_process.cc')
-rw-r--r--winsup/cygwin/fhandler_process.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 36270d1ba..91e2286d0 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
}};
}