src/util/datalimit.c File Reference

#include "util.h"
Include dependency graph for datalimit.c:

Go to the source code of this file.

Defines

#define RLIMIT_DATA_DEFAULT   67108864

Functions

unsigned long getSoftDataLimit (void)

Variables

static char rcsid[] UNUSED = "$Id: datalimit.c,v 1.6 2008/04/25 07:00:55 fabio Exp $"

Define Documentation

#define RLIMIT_DATA_DEFAULT   67108864

Definition at line 45 of file datalimit.c.


Function Documentation

unsigned long getSoftDataLimit ( void   ) 

AutomaticStart AutomaticEnd Function********************************************************************

Synopsis [Function that computes the data limit of the process.]

SideEffects []

Definition at line 72 of file datalimit.c.

00073 {
00074 #if HAVE_SYS_RESOURCE_H && HAVE_GETRLIMIT && defined(RLIMIT_DATA)
00075     struct rlimit rl;
00076     int result;
00077 
00078     result = getrlimit(RLIMIT_DATA, &rl);
00079     if (result != 0 || rl.rlim_cur == RLIM_INFINITY)
00080         return((unsigned long) RLIMIT_DATA_DEFAULT);
00081     else
00082         return((unsigned long) rl.rlim_cur);
00083 #else
00084     return((unsigned long) RLIMIT_DATA_DEFAULT);
00085 #endif
00086 
00087 } /* end of getSoftDataLimit */


Variable Documentation

char rcsid [] UNUSED = "$Id: datalimit.c,v 1.6 2008/04/25 07:00:55 fabio Exp $" [static]

CFile************************************************************************

FileName [datalimit.c]

PackageName [util]

Synopsis [Routine to obtain the maximum data size available to a program. The routine is based on "getrlimit". If the system does not have this function, the default value RLIMIT_DATA_DEFAULT is assumed. This function provides an informative value, it does not restrict the size of the program in any way.]

Author [Fabio Somenzi <fabio@colorado.edu>]

Copyright [This file was created at the University of Colorado at Boulder. The University of Colorado at Boulder makes no warranty about the suitability of this software for any purpose. It is presented on an AS IS basis.]

Definition at line 23 of file datalimit.c.


Generated on Tue Jan 12 13:57:28 2010 for glu-2.2 by  doxygen 1.6.1