diff options
| author | Toby Goodwin <tgoodwin@cygnus.co.uk> | 1997-07-07 00:00:01 +0100 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:22:59 +0100 |
| commit | b87bfedf65c289bf0ee5338c9e10492b70b1e8e0 (patch) | |
| tree | 906ba5d55d6993f59d7bb1def63d494bafd38728 /rlimit.h | |
| parent | 5556dde4d3ad4e34267320b1411fc090b18a24b0 (diff) | |
beta: rc-1.5b2
Diffstat (limited to 'rlimit.h')
| -rw-r--r-- | rlimit.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/rlimit.h b/rlimit.h new file mode 100644 index 0000000..f6e179b --- /dev/null +++ b/rlimit.h @@ -0,0 +1,42 @@ +/* What a mess. This file attempts to straighten everything out. */ + +#if HAVE_SETRLIMIT + +#if HAVE_SYS_RESOURCE_H +# include <sys/time.h> +# if RLIMIT_NEEDS_KERNEL +# define _KERNEL +# endif +# include <sys/resource.h> +# if RLIMIT_NEEDS_KERNEL +# undef _KERNEL +# endif +#else +# include <sys/times.h> +#endif + +#if HAVE_LIMITS_H +# include <limits.h> +#endif + +#ifndef HAVE_RLIM_T +# if RLIM_T_IS_QUAD_T +typedef quad_t rlim_t; +# else +typedef long rlim_t; +# endif +#endif + +#if HAVE_QUAD_T +# define RLIM_CONV quad_t +# define RLIM_FMT "%s \t%qd%s\n" +#else +# define RLIM_CONV long +# define RLIM_FMT "%s \t%ld%s\n" +#endif + +#if defined(RLIMIT_OFILE) && !defined (RLIMIT_NOFILE) +# define RLIMIT_NOFILE RLIMIT_OFILE +#endif + +#endif /* HAVE_SETRLIMIT */ |