1da2e3ebdSchin /***********************************************************************
2da2e3ebdSchin *                                                                      *
3da2e3ebdSchin *               This software is part of the ast package               *
4*b30d1939SAndy Fiddaman *          Copyright (c) 1982-2012 AT&T Intellectual Property          *
5da2e3ebdSchin *                      and is licensed under the                       *
6*b30d1939SAndy Fiddaman *                 Eclipse Public License, Version 1.0                  *
77c2fbfb3SApril Chin *                    by AT&T Intellectual Property                     *
8da2e3ebdSchin *                                                                      *
9da2e3ebdSchin *                A copy of the License is available at                 *
10*b30d1939SAndy Fiddaman *          http://www.eclipse.org/org/documents/epl-v10.html           *
11*b30d1939SAndy Fiddaman *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
12da2e3ebdSchin *                                                                      *
13da2e3ebdSchin *              Information and Software Systems Research               *
14da2e3ebdSchin *                            AT&T Research                             *
15da2e3ebdSchin *                           Florham Park NJ                            *
16da2e3ebdSchin *                                                                      *
17da2e3ebdSchin *                  David Korn <dgk@research.att.com>                   *
18da2e3ebdSchin *                                                                      *
19da2e3ebdSchin ***********************************************************************/
20da2e3ebdSchin #pragma prototyped
21da2e3ebdSchin 
22da2e3ebdSchin #include	<ast.h>
23da2e3ebdSchin #include	"ulimit.h"
24da2e3ebdSchin 
25da2e3ebdSchin /*
26da2e3ebdSchin  * This is the list of resouce limits controlled by ulimit
27da2e3ebdSchin  * This command requires getrlimit(), vlimit(), or ulimit()
28da2e3ebdSchin  */
29da2e3ebdSchin 
30da2e3ebdSchin #ifndef _no_ulimit
31da2e3ebdSchin 
32da2e3ebdSchin const char	e_unlimited[] = "unlimited";
33*b30d1939SAndy Fiddaman const char*	e_units[] = { 0, "block", "byte", "Kibyte", "second" };
34da2e3ebdSchin 
35da2e3ebdSchin const int	shtab_units[] = { 1, 512, 1, 1024, 1 };
36da2e3ebdSchin 
37da2e3ebdSchin const Limit_t	shtab_limits[] =
38da2e3ebdSchin {
39da2e3ebdSchin "as",		"address space limit",	RLIMIT_AS,	0,		'M',	LIM_KBYTE,
40da2e3ebdSchin "core",		"core file size",	RLIMIT_CORE,	0,		'c',	LIM_BLOCK,
41da2e3ebdSchin "cpu",		"cpu time",		RLIMIT_CPU,	0,		't',	LIM_SECOND,
42da2e3ebdSchin "data",		"data size",		RLIMIT_DATA,	0,		'd',	LIM_KBYTE,
43da2e3ebdSchin "fsize",	"file size",		RLIMIT_FSIZE,	0,		'f',	LIM_BLOCK,
44*b30d1939SAndy Fiddaman "locks",	"number of file locks",	RLIMIT_LOCKS,	0,		'x',	LIM_COUNT,
45da2e3ebdSchin "memlock",	"locked address space",	RLIMIT_MEMLOCK,	0,		'l',	LIM_KBYTE,
46*b30d1939SAndy Fiddaman "msgqueue",	"message queue size",	RLIMIT_MSGQUEUE,0,		'q',	LIM_KBYTE,
47*b30d1939SAndy Fiddaman "nice",		"scheduling priority",	RLIMIT_NICE,	0,		'e',	LIM_COUNT,
48da2e3ebdSchin "nofile",	"number of open files",	RLIMIT_NOFILE,	"OPEN_MAX",	'n',	LIM_COUNT,
49da2e3ebdSchin "nproc",	"number of processes",	RLIMIT_NPROC,	"CHILD_MAX",	'u',	LIM_COUNT,
50da2e3ebdSchin "pipe",		"pipe buffer size",	RLIMIT_PIPE,	"PIPE_BUF",	'p',	LIM_BYTE,
51*b30d1939SAndy Fiddaman "rss",		"max memory size",	RLIMIT_RSS,	0,		'm',	LIM_KBYTE,
52*b30d1939SAndy Fiddaman "rtprio",	"max real time priority",RLIMIT_RTPRIO,	0,		'r',	LIM_COUNT,
53da2e3ebdSchin "sbsize",	"socket buffer size",	RLIMIT_SBSIZE,	"PIPE_BUF",	'b',	LIM_BYTE,
54*b30d1939SAndy Fiddaman "sigpend",	"signal queue size",	RLIMIT_SIGPENDING,"SIGQUEUE_MAX",'i',	LIM_COUNT,
55da2e3ebdSchin "stack",	"stack size",		RLIMIT_STACK,	0,		's',	LIM_KBYTE,
56*b30d1939SAndy Fiddaman "swap",		"swap size",		RLIMIT_SWAP,	0,		'w',	LIM_KBYTE,
57da2e3ebdSchin "threads",	"number of threads",	RLIMIT_PTHREAD,	"THREADS_MAX",	'T',	LIM_COUNT,
58da2e3ebdSchin "vmem",		"process size",		RLIMIT_VMEM,	0,		'v',	LIM_KBYTE,
59da2e3ebdSchin { 0 }
60da2e3ebdSchin };
61da2e3ebdSchin 
62da2e3ebdSchin #endif
63