mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
* autoload.cc (GetProcessMemoryInfo): Remove.
* resource.cc (fill_rusage): Call NtQueryInformationProcess rather than GetProcessMemoryInfo to drop a psapi dependency.
This commit is contained in:
parent
933d2af50d
commit
34a6eeabff
@ -1,3 +1,9 @@
|
|||||||
|
2011-05-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* autoload.cc (GetProcessMemoryInfo): Remove.
|
||||||
|
* resource.cc (fill_rusage): Call NtQueryInformationProcess rather than
|
||||||
|
GetProcessMemoryInfo to drop a psapi dependency.
|
||||||
|
|
||||||
2011-05-11 Corinna Vinschen <corinna@vinschen.de>
|
2011-05-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc (get_inet_addr): Rearrange for better readability.
|
* fhandler_socket.cc (get_inet_addr): Rearrange for better readability.
|
||||||
|
@ -417,7 +417,6 @@ LoadDLLfunc (CoTaskMemFree, 4, ole32)
|
|||||||
LoadDLLfunc (EnumProcessModules, 16, psapi)
|
LoadDLLfunc (EnumProcessModules, 16, psapi)
|
||||||
LoadDLLfunc (GetModuleFileNameExW, 16, psapi)
|
LoadDLLfunc (GetModuleFileNameExW, 16, psapi)
|
||||||
LoadDLLfunc (GetModuleInformation, 16, psapi)
|
LoadDLLfunc (GetModuleInformation, 16, psapi)
|
||||||
LoadDLLfunc (GetProcessMemoryInfo, 12, psapi)
|
|
||||||
LoadDLLfunc (QueryWorkingSet, 12, psapi)
|
LoadDLLfunc (QueryWorkingSet, 12, psapi)
|
||||||
|
|
||||||
LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32)
|
LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* resource.cc: getrusage () and friends.
|
/* resource.cc: getrusage () and friends.
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009, 2010 Red Hat, Inc.
|
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009, 2010, 2011 Red Hat, Inc.
|
||||||
|
|
||||||
Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com),
|
Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com),
|
||||||
Geoffrey Noer (noer@cygnus.com) of Cygnus Support.
|
Geoffrey Noer (noer@cygnus.com) of Cygnus Support.
|
||||||
@ -22,6 +22,7 @@ details. */
|
|||||||
#include "pinfo.h"
|
#include "pinfo.h"
|
||||||
#include "dtable.h"
|
#include "dtable.h"
|
||||||
#include "cygheap.h"
|
#include "cygheap.h"
|
||||||
|
#include "ntdll.h"
|
||||||
|
|
||||||
/* add timeval values */
|
/* add timeval values */
|
||||||
static void
|
static void
|
||||||
@ -76,13 +77,13 @@ fill_rusage (struct rusage *r, HANDLE h)
|
|||||||
totimeval (&tv, &user_time, 0, 0);
|
totimeval (&tv, &user_time, 0, 0);
|
||||||
add_timeval (&r->ru_utime, &tv);
|
add_timeval (&r->ru_utime, &tv);
|
||||||
|
|
||||||
PROCESS_MEMORY_COUNTERS pmc;
|
VM_COUNTERS vmc;
|
||||||
|
NTSTATUS status = NtQueryInformationProcess (h, ProcessVmCounters, &vmc,
|
||||||
memset (&pmc, 0, sizeof (pmc));
|
sizeof vmc, NULL);
|
||||||
if (GetProcessMemoryInfo (h, &pmc, sizeof (pmc)))
|
if (NT_SUCCESS (status))
|
||||||
{
|
{
|
||||||
r->ru_maxrss += (long) (pmc.WorkingSetSize /1024);
|
r->ru_maxrss += (long) (vmc.WorkingSetSize / 1024);
|
||||||
r->ru_majflt += pmc.PageFaultCount;
|
r->ru_majflt += vmc.PageFaultCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user