annotate src/mem-limits.h @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 677f6a0ee643
children 6330739388db
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
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
64 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__)
0
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 extern POINTER start_of_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 #ifdef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #define EXCEEDS_LISP_PTR(ptr) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 #define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #ifdef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #ifndef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 extern int etext;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #define start_of_data() &etext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
112 #else /* not emacs */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 extern char etext;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #define start_of_data() &etext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif /* not emacs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #endif /* not _LIBC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
119
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 /* start of data space; can be changed by calling malloc_init */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 static POINTER data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /* 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
125 extern unsigned int lim_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
127 #ifdef HEAP_IN_DATA
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
128 extern unsigned long static_heap_size;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
129 extern int initialized;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
130 static void
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
131 get_lim_data (void)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
132 {
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
133 if (!initialized)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
134 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
135 lim_data = (unsigned int) -1; /* static_heap_size; */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
136 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
137 else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
138 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
139 lim_data = (unsigned int) -1;
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
140 }
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
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 #ifdef NO_LIM_DATA
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
145 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
147 lim_data = (unsigned int) -1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #else /* not NO_LIM_DATA */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #ifdef USG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
154 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
156 lim_data = (unsigned int) -1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 /* Use the ulimit call, if we seem to have it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 lim_data = ulimit (3, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 /* If that didn't work, just use the macro's value. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #ifdef ULIMIT_BREAK_VALUE
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
165 if (lim_data == (unsigned int) -1)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 lim_data = ULIMIT_BREAK_VALUE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 lim_data -= (long) data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #else /* not USG */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
173 #if defined( WINDOWSNT )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
176 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 extern unsigned long data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 lim_data = data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #if !defined (BSD4_2) && !defined (__osf__)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
187 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 _go32_dpmi_meminfo info;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 _go32_dpmi_get_free_memory_information (&info);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 lim_data = info.available_memory;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #else /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
196 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 lim_data = vlimit (LIM_DATA, -1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #endif /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #else /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
205 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 struct rlimit XXrlimit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 getrlimit (RLIMIT_DATA, &XXrlimit);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 #ifdef RLIM_INFINITY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 lim_data = XXrlimit.rlim_cur; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 #endif /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #endif /* not USG */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #endif /* not NO_LIM_DATA */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
220 #endif /* not HEAP_IN_DATA */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 #endif /* _XEMACS_MEM_LIMITS_H_ */