annotate src/mem-limits.h @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents f220cc83d72e
children c5d627a313b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Includes for memory limit warnings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1990, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: FSF 19.30. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
23 /* #### This ancient code really sucks.
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
24 configure should check for:
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
25 HAVE_SYS_RESOURCE_H, HAVE_ULIMIT_H, HAVE_GETRLIMIT, HAVE_ULIMIT,
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
26 and select action based on those values.
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
27 getrlimit() should be preferred to ulimit().
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
28 On Linux, ulimit() is deprecated and always returns -1. */
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
29
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #ifndef _XEMACS_MEM_LIMITS_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #define _XEMACS_MEM_LIMITS_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
33 #ifdef HAVE_CONFIG_H
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
34 #include <config.h>
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
35 #endif
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
36
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
37 #ifdef HAVE_ULIMIT_H
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
38 #include <ulimit.h>
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
39 #endif
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 74
diff changeset
40
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #include <dpmi.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 /* Some systems need this before <sys/resource.h>. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #include <sys/types.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #ifdef _LIBC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #include <sys/resource.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #define BSD4_2 /* Tell code below to use getrlimit. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 /* Old Linux startup code won't define __data_start. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 extern int etext, __data_start; weak_symbol (__data_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 #define start_of_data() (&__data_start ?: &etext)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 231
diff changeset
57 #else /* not GNU libc */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #if defined (__osf__) && (defined (__mips) || defined (mips) || defined (__alpha))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #include <sys/time.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 #include <sys/resource.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #if defined(__bsdi__) || defined(__NetBSD__)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #define BSD4_2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #ifndef BSD4_2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 #ifndef USG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #ifndef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #ifndef WINDOWSNT
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
72 #ifndef __CYGWIN32__
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #include <sys/vlimit.h>
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
74 #endif /* not __CYGWIN32__ */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 #endif /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 #endif /* not USG */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #else /* if BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #include <sys/time.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 #include <sys/resource.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #endif /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /* The important properties of this type are that 1) it's a pointer, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 2) arithmetic on it should work as if the size of the object pointed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 to has a size of 1. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #ifdef __STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 typedef void *POINTER;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 typedef char *POINTER;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
93 #ifndef __CYGWIN32__
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 typedef unsigned long SIZE;
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
95 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #ifdef NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 #undef NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 #define NULL ((POINTER) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 extern POINTER start_of_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #ifdef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 #define EXCEEDS_LISP_PTR(ptr) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 #define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #ifdef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #ifndef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 extern int etext;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #define start_of_data() &etext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #else /* not emacs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 extern char etext;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 #define start_of_data() &etext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #endif /* not emacs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #endif /* not _LIBC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 /* start of data space; can be changed by calling malloc_init */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 static POINTER data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 /* Number of bytes of writable memory we can expect to be able to get */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 extern unsigned int lim_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
132 #ifdef HEAP_IN_DATA
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
133 extern unsigned long static_heap_size;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
134 extern int initialized;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
135 static void
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
136 get_lim_data (void)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
137 {
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
138 if (!initialized)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
139 {
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
140 lim_data = -1; /* static_heap_size; */
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
141 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
142 else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
143 {
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
144 lim_data = -1;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
145 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
146 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
147 #else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 #ifdef NO_LIM_DATA
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
150 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 lim_data = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #else /* not NO_LIM_DATA */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #ifdef USG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
159 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 lim_data = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 /* Use the ulimit call, if we seem to have it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 lim_data = ulimit (3, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 /* If that didn't work, just use the macro's value. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 #ifdef ULIMIT_BREAK_VALUE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 if (lim_data == -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 lim_data = ULIMIT_BREAK_VALUE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 lim_data -= (long) data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 #else /* not USG */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
178 #if defined( WINDOWSNT )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
181 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 extern unsigned long data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 lim_data = data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 #if !defined (BSD4_2) && !defined (__osf__)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
192 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 _go32_dpmi_meminfo info;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 _go32_dpmi_get_free_memory_information (&info);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 lim_data = info.available_memory;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #else /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
201 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 lim_data = vlimit (LIM_DATA, -1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #endif /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #else /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
210 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 struct rlimit XXrlimit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 getrlimit (RLIMIT_DATA, &XXrlimit);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #ifdef RLIM_INFINITY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 lim_data = XXrlimit.rlim_cur; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #endif /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 #endif /* not USG */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 #endif /* not NO_LIM_DATA */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
225 #endif /* not HEAP_IN_DATA */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 #endif /* _XEMACS_MEM_LIMITS_H_ */