File: rlimit.h

package info (click to toggle)
rc 1.7.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 856 kB
  • ctags: 814
  • sloc: ansic: 7,121; sh: 714; yacc: 124; makefile: 94
file content (53 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* 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

struct Suffix {
	const struct Suffix *next;
	long amount;
	char *name;
};

struct Limit {
	char *name;
	int flag;
	const struct Suffix *suffix;
};
#endif /* HAVE_SETRLIMIT */