Fixed writable memory.

2006-06-24  Benoît Dejean  <benoit@placenet.org>

	* procmap.c: (glibtop_get_proc_map_s):

	Fixed writable memory.

	Patch by hua.zhang@sun.com.
	Closes #345817.
This commit is contained in:
Benoît Dejean
2006-06-24 17:45:29 +00:00
committed by Benoît Dejean
parent bc6ff2cb59
commit c7e0a7ac59
2 changed files with 18 additions and 7 deletions

View File

@@ -1,3 +1,12 @@
2006-06-24 Benoît Dejean <benoit@placenet.org>
* procmap.c: (glibtop_get_proc_map_s):
Fixed writable memory.
Patch by hua.zhang@sun.com.
Closes #345817.
2006-06-24 Benoît Dejean <benoit@placenet.org>
* open.c: (glibtop_get_kstats), (glibtop_open_s):

View File

@@ -56,7 +56,7 @@ glibtop_map_entry *
glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
{
int fd, i, nmaps, pr_err, heap;
#if GLIBTOP_SOLARIS_RELEASE >= 560
#if GLIBTOP_SOLARIS_RELEASE >= 50600
prxmap_t *maps;
struct ps_prochandle *Pr = NULL;
#else
@@ -125,7 +125,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
buf->total = nmaps * sizeof(glibtop_map_entry);
entry = g_malloc0(buf->total);
#if GLIBTOP_SOLARIS_RELEASE >= 560
#if GLIBTOP_SOLARIS_RELEASE >= 50600
if(server->machine.objname && server->machine.pgrab &&
server->machine.pfree)
@@ -138,7 +138,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
entry[i].start = maps[i].pr_vaddr;
entry[i].end = maps[i].pr_vaddr + maps[i].pr_size;
#if GLIBTOP_SOLARIS_RELEASE >= 560
#if GLIBTOP_SOLARIS_RELEASE >= 50600
if(maps[i].pr_dev != PRNODEV)
{
@@ -150,8 +150,10 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
entry[i].offset = maps[i].OFFSET;
if(maps[i].pr_mflags & MA_READ)
entry[i].perm |= GLIBTOP_MAP_PERM_READ;
if(maps[i].pr_mflags & MA_WRITE)
if(maps[i].pr_mflags & MA_WRITE){
entry[i].perm |= GLIBTOP_MAP_PERM_WRITE;
entry[i].size = maps[i].pr_size;
}
if(maps[i].pr_mflags & MA_EXEC)
entry[i].perm |= GLIBTOP_MAP_PERM_EXECUTE;
if(maps[i].pr_mflags & MA_SHARED)
@@ -160,7 +162,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
entry[i].perm |= GLIBTOP_MAP_PERM_PRIVATE;
entry[i].flags = _glibtop_sysdeps_map_entry;
#if GLIBTOP_SOLARIS_RELEASE >= 560
#if GLIBTOP_SOLARIS_RELEASE >= 50600
if(maps[i].pr_mflags & MA_ANON)
{
@@ -191,7 +193,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
#endif
}
#if GLIBTOP_SOLARIS_RELEASE >= 560
#if GLIBTOP_SOLARIS_RELEASE >= 50600
if(Pr)
server->machine.pfree(Pr);