xref: /titanic_50/usr/src/lib/libshell/common/data/limits.c (revision 495db6fbcd9e8ab893e91f6f5627df6e0cec63cf)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1982-2008 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                  David Korn <dgk@research.att.com>                   *
18 *                                                                      *
19 ***********************************************************************/
20 #pragma prototyped
21 
22 #include	<ast.h>
23 #include	"ulimit.h"
24 
25 /*
26  * This is the list of resouce limits controlled by ulimit
27  * This command requires getrlimit(), vlimit(), or ulimit()
28  */
29 
30 #ifndef _no_ulimit
31 
32 const char	e_unlimited[] = "unlimited";
33 const char*	e_units[] = { 0, "block", "byte", "kbyte", "second" };
34 
35 const int	shtab_units[] = { 1, 512, 1, 1024, 1 };
36 
37 const Limit_t	shtab_limits[] =
38 {
39 "as",		"address space limit",	RLIMIT_AS,	0,		'M',	LIM_KBYTE,
40 "core",		"core file size",	RLIMIT_CORE,	0,		'c',	LIM_BLOCK,
41 "cpu",		"cpu time",		RLIMIT_CPU,	0,		't',	LIM_SECOND,
42 "data",		"data size",		RLIMIT_DATA,	0,		'd',	LIM_KBYTE,
43 "fsize",	"file size",		RLIMIT_FSIZE,	0,		'f',	LIM_BLOCK,
44 "locks",	"number of file locks",	RLIMIT_LOCKS,	0,		'L',	LIM_COUNT,
45 "memlock",	"locked address space",	RLIMIT_MEMLOCK,	0,		'l',	LIM_KBYTE,
46 "nofile",	"number of open files",	RLIMIT_NOFILE,	"OPEN_MAX",	'n',	LIM_COUNT,
47 "nproc",	"number of processes",	RLIMIT_NPROC,	"CHILD_MAX",	'u',	LIM_COUNT,
48 "pipe",		"pipe buffer size",	RLIMIT_PIPE,	"PIPE_BUF",	'p',	LIM_BYTE,
49 "rss",		"resident set size",	RLIMIT_RSS,	0,		'm',	LIM_KBYTE,
50 "sbsize",	"socket buffer size",	RLIMIT_SBSIZE,	"PIPE_BUF",	'b',	LIM_BYTE,
51 "stack",	"stack size",		RLIMIT_STACK,	0,		's',	LIM_KBYTE,
52 "threads",	"number of threads",	RLIMIT_PTHREAD,	"THREADS_MAX",	'T',	LIM_COUNT,
53 "vmem",		"process size",		RLIMIT_VMEM,	0,		'v',	LIM_KBYTE,
54 { 0 }
55 };
56 
57 #endif
58