diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-04-20 10:44:52 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-04-20 10:44:52 +0000 |
commit | 9e40fe81120619ab9fb1f610d7c2a5062915dca4 (patch) | |
tree | 4ea4b69163ece41dbf84f7f8e2dc45e726c4b22e /winsup/cygwin/resource.cc | |
parent | 2ac91a14831702681737bfac01e0772f04375b49 (diff) | |
download | cygnal-9e40fe81120619ab9fb1f610d7c2a5062915dca4.tar.gz cygnal-9e40fe81120619ab9fb1f610d7c2a5062915dca4.tar.bz2 cygnal-9e40fe81120619ab9fb1f610d7c2a5062915dca4.zip |
* cygheap.h (struct init_cygheap): Add rlim_core member.
* cygheap.cc (cygheap_init): Initialize rlim_core to RLIM_INFINITY.
* exceptions.cc (stackdump): Drop extern declaration of rlim_core.
Refer to cygheap->rlim_core instead.
(exception::handle): Disable stackdumping if cygheap->rlim_core is 0.
Don't set WCOREDUMP flag in exit code, if cygheap->rlim_core is 0.
(sigpacket::process): Ditto.
* resource.cc (rlim_core): Remove.
(getrlimit): Fetch RLIMIT_CORE value from cygheap->rlim_core.
(setrlimit): Store RLIMIT_CORE value in cygheap->rlim_core.
Diffstat (limited to 'winsup/cygwin/resource.cc')
-rw-r--r-- | winsup/cygwin/resource.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc index 6da9c6814..fed61e8ee 100644 --- a/winsup/cygwin/resource.cc +++ b/winsup/cygwin/resource.cc @@ -1,6 +1,6 @@ /* resource.cc: getrusage () and friends. - Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009 Red Hat, Inc. + Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009, 2010 Red Hat, Inc. Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com), Geoffrey Noer (noer@cygnus.com) of Cygnus Support. @@ -21,6 +21,7 @@ details. */ #include "fhandler.h" #include "pinfo.h" #include "dtable.h" +#include "cygheap.h" /* add timeval values */ static void @@ -109,8 +110,6 @@ getrusage (int intwho, struct rusage *rusage_in) return res; } -unsigned long rlim_core = RLIM_INFINITY; - extern "C" int getrlimit (int resource, struct rlimit *rlp) { @@ -146,7 +145,7 @@ getrlimit (int resource, struct rlimit *rlp) rlp->rlim_max = OPEN_MAX_MAX; break; case RLIMIT_CORE: - rlp->rlim_cur = rlim_core; + rlp->rlim_cur = cygheap->rlim_core; break; case RLIMIT_AS: rlp->rlim_cur = 0x80000000UL; @@ -182,7 +181,7 @@ setrlimit (int resource, const struct rlimit *rlp) switch (resource) { case RLIMIT_CORE: - rlim_core = rlp->rlim_cur; + cygheap->rlim_core = rlp->rlim_cur; break; case RLIMIT_NOFILE: if (rlp->rlim_cur != RLIM_INFINITY) |