/* This testcase is part of GDB, the GNU debugger.
- Copyright 2004, 2007 Free Software Foundation, Inc.
+ Copyright 2004-2013 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- Please email any bugs, comments, and/or additions to this file to:
- bug-gdb@prep.ai.mit.edu */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Get 64-bit stuff if on a GNU system. */
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
+/* This test was written for >2GB core files on 32-bit systems. On
+ current 64-bit systems, generating a >4EB (2 ** 63) core file is
+ not practical, and getting as close as we can takes a lot of
+ useless CPU time. So limit ourselves to a bit bigger than
+ 32-bit, which is still a useful test. */
+#define RLIMIT_CAP (1ULL << 34)
+
/* Print routines:
The following are so that printf et.al. can be avoided. Those
print_rlimit (resource);
getrlimit (resource, &rl);
rl.rlim_cur = rl.rlim_max;
+ if (sizeof (rl.rlim_cur) >= sizeof (RLIMIT_CAP))
+ rl.rlim_cur = (rlim_t) RLIMIT_CAP;
setrlimit (resource, &rl);
print_string (" -> ");
print_rlimit (resource);