annotate src/mem-limits.h @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents 57709be46d1b
children 7d59cb494b73
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
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 276
diff changeset
64 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__)
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
65 #if defined(__linux__) && defined (powerpc) /*Added by Fukui*/
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
66 #else /*Added by Fukui*/
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #define BSD4_2
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
68 #endif /*Added by Fukui*/
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #ifndef BSD4_2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #ifndef USG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #ifndef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #ifndef WINDOWSNT
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
75 #ifndef __CYGWIN32__
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
76 #if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
77 #else /*Added Kaoru Fukui*/
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #include <sys/vlimit.h>
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 272
diff changeset
79 #endif /*Added by Fukui*/
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
80 #endif /* not __CYGWIN32__ */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 #endif /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 #endif /* not USG */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 #else /* if BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 #include <sys/time.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #include <sys/resource.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #endif /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 /* 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
91 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
92 to has a size of 1. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 #ifdef __STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 typedef void *POINTER;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 typedef char *POINTER;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
99 #ifndef __CYGWIN32__
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 typedef unsigned long SIZE;
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 169
diff changeset
101 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 extern POINTER start_of_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 #ifdef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #define EXCEEDS_LISP_PTR(ptr) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS)
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #ifdef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 #ifndef DATA_SEG_BITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 extern int 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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
118 #else /* not emacs */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 extern char etext;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #define start_of_data() &etext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #endif /* not emacs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 #endif /* not _LIBC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
125
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 /* start of data space; can be changed by calling malloc_init */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 static POINTER data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 /* 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
131 extern unsigned int lim_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
133 #ifdef HEAP_IN_DATA
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
134 extern unsigned long static_heap_size;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
135 extern int initialized;
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
136 static void
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
137 get_lim_data (void)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
138 {
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
139 if (!initialized)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
140 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
141 lim_data = (unsigned int) -1; /* static_heap_size; */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
142 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
143 else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
144 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
145 lim_data = (unsigned int) -1;
251
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 }
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
148 #else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #ifdef NO_LIM_DATA
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
151 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
153 lim_data = (unsigned int) -1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #else /* not NO_LIM_DATA */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #ifdef USG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
160 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
162 lim_data = (unsigned int) -1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 /* Use the ulimit call, if we seem to have it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 lim_data = ulimit (3, 0);
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 /* If that didn't work, just use the macro's value. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 #ifdef ULIMIT_BREAK_VALUE
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
171 if (lim_data == (unsigned int) -1)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 lim_data = ULIMIT_BREAK_VALUE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 lim_data -= (long) data_space_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 #else /* not USG */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
179 #if defined( WINDOWSNT )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
182 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 extern unsigned long data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 lim_data = data_region_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 #if !defined (BSD4_2) && !defined (__osf__)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
193 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 _go32_dpmi_meminfo info;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 _go32_dpmi_get_free_memory_information (&info);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 lim_data = info.available_memory;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #else /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
202 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 lim_data = vlimit (LIM_DATA, -1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #endif /* not MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #else /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 static void
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
211 get_lim_data (void)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 struct rlimit XXrlimit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 getrlimit (RLIMIT_DATA, &XXrlimit);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 #ifdef RLIM_INFINITY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 lim_data = XXrlimit.rlim_cur; /* soft limit */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 #endif
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 /* BSD4_2 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 #endif /* not USG */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 #endif /* not NO_LIM_DATA */
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 243
diff changeset
226 #endif /* not HEAP_IN_DATA */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 #endif /* _XEMACS_MEM_LIMITS_H_ */