diff options
author | Christopher Faylor <me@cgf.cx> | 2001-10-22 00:10:46 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-10-22 00:10:46 +0000 |
commit | d055070040654610896be026dbe561d8570b7bb6 (patch) | |
tree | beef1151ad326f34fa360f65c97df7cbe7b33408 /winsup/cygwin | |
parent | 1f0191e5425474567dc786c14d84a59df597855f (diff) | |
download | cygnal-d055070040654610896be026dbe561d8570b7bb6.tar.gz cygnal-d055070040654610896be026dbe561d8570b7bb6.tar.bz2 cygnal-d055070040654610896be026dbe561d8570b7bb6.zip |
* resource.cc (fill_rusage): Perform paranoid zero structure passed to
GetProcessMemoryInfo.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/resource.cc | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6fb321b57..4d2c4295a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2001-10-21 Christopher Faylor <cgf@redhat.com> + + * resource.cc (fill_rusage): Perform paranoid zero structure passed to + GetProcessMemoryInfo. + 2001-10-22 Robert Collins <rbtcollins@hotmail.com> * autoload.cc: Autoload GetProcessMemoryInfo. diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc index 9c949e4c0..e9121e94c 100644 --- a/winsup/cygwin/resource.cc +++ b/winsup/cygwin/resource.cc @@ -77,6 +77,7 @@ fill_rusage (struct rusage *r, HANDLE h) PROCESS_MEMORY_COUNTERS pmc; + memset (&pmc, 0, sizeof (pmc)); if (GetProcessMemoryInfo( h, &pmc, sizeof (pmc))) { r->ru_maxrss += (long) (pmc.WorkingSetSize /1024); @@ -111,8 +112,7 @@ getrusage (int intwho, struct rusage *rusage_in) unsigned long rlim_core = RLIM_INFINITY; -extern "C" -int +extern "C" int getrlimit (int resource, struct rlimit *rlp) { MEMORY_BASIC_INFORMATION m; @@ -156,8 +156,7 @@ getrlimit (int resource, struct rlimit *rlp) return 0; } -extern "C" -int +extern "C" int setrlimit (int resource, const struct rlimit *rlp) { if (check_null_invalid_struct_errno (rlp)) |