xref: /onnv-gate/usr/src/lib/libshell/common/data/limits.c (revision 12068:08a39a083754)
14887Schin /***********************************************************************
24887Schin *                                                                      *
34887Schin *               This software is part of the ast package               *
4*12068SRoger.Faulkner@Oracle.COM *          Copyright (c) 1982-2010 AT&T Intellectual Property          *
54887Schin *                      and is licensed under the                       *
64887Schin *                  Common Public License, Version 1.0                  *
78462SApril.Chin@Sun.COM *                    by AT&T Intellectual Property                     *
84887Schin *                                                                      *
94887Schin *                A copy of the License is available at                 *
104887Schin *            http://www.opensource.org/licenses/cpl1.0.txt             *
114887Schin *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
124887Schin *                                                                      *
134887Schin *              Information and Software Systems Research               *
144887Schin *                            AT&T Research                             *
154887Schin *                           Florham Park NJ                            *
164887Schin *                                                                      *
174887Schin *                  David Korn <dgk@research.att.com>                   *
184887Schin *                                                                      *
194887Schin ***********************************************************************/
204887Schin #pragma prototyped
214887Schin 
224887Schin #include	<ast.h>
234887Schin #include	"ulimit.h"
244887Schin 
254887Schin /*
264887Schin  * This is the list of resouce limits controlled by ulimit
274887Schin  * This command requires getrlimit(), vlimit(), or ulimit()
284887Schin  */
294887Schin 
304887Schin #ifndef _no_ulimit
314887Schin 
324887Schin const char	e_unlimited[] = "unlimited";
334887Schin const char*	e_units[] = { 0, "block", "byte", "kbyte", "second" };
344887Schin 
354887Schin const int	shtab_units[] = { 1, 512, 1, 1024, 1 };
364887Schin 
374887Schin const Limit_t	shtab_limits[] =
384887Schin {
394887Schin "as",		"address space limit",	RLIMIT_AS,	0,		'M',	LIM_KBYTE,
404887Schin "core",		"core file size",	RLIMIT_CORE,	0,		'c',	LIM_BLOCK,
414887Schin "cpu",		"cpu time",		RLIMIT_CPU,	0,		't',	LIM_SECOND,
424887Schin "data",		"data size",		RLIMIT_DATA,	0,		'd',	LIM_KBYTE,
434887Schin "fsize",	"file size",		RLIMIT_FSIZE,	0,		'f',	LIM_BLOCK,
444887Schin "locks",	"number of file locks",	RLIMIT_LOCKS,	0,		'L',	LIM_COUNT,
454887Schin "memlock",	"locked address space",	RLIMIT_MEMLOCK,	0,		'l',	LIM_KBYTE,
464887Schin "nofile",	"number of open files",	RLIMIT_NOFILE,	"OPEN_MAX",	'n',	LIM_COUNT,
474887Schin "nproc",	"number of processes",	RLIMIT_NPROC,	"CHILD_MAX",	'u',	LIM_COUNT,
484887Schin "pipe",		"pipe buffer size",	RLIMIT_PIPE,	"PIPE_BUF",	'p',	LIM_BYTE,
494887Schin "rss",		"resident set size",	RLIMIT_RSS,	0,		'm',	LIM_KBYTE,
504887Schin "sbsize",	"socket buffer size",	RLIMIT_SBSIZE,	"PIPE_BUF",	'b',	LIM_BYTE,
514887Schin "stack",	"stack size",		RLIMIT_STACK,	0,		's',	LIM_KBYTE,
524887Schin "threads",	"number of threads",	RLIMIT_PTHREAD,	"THREADS_MAX",	'T',	LIM_COUNT,
534887Schin "vmem",		"process size",		RLIMIT_VMEM,	0,		'v',	LIM_KBYTE,
544887Schin { 0 }
554887Schin };
564887Schin 
574887Schin #endif
58