1da2e3ebdSchin /*********************************************************************** 2da2e3ebdSchin * * 3da2e3ebdSchin * This software is part of the ast package * 4*3e14f97fSRoger A. Faulkner * Copyright (c) 1982-2010 AT&T Intellectual Property * 5da2e3ebdSchin * and is licensed under the * 6da2e3ebdSchin * Common Public License, Version 1.0 * 77c2fbfb3SApril Chin * by AT&T Intellectual Property * 8da2e3ebdSchin * * 9da2e3ebdSchin * A copy of the License is available at * 10da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt * 11da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 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"; 33da2e3ebdSchin const char* e_units[] = { 0, "block", "byte", "kbyte", "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, 44da2e3ebdSchin "locks", "number of file locks", RLIMIT_LOCKS, 0, 'L', LIM_COUNT, 45da2e3ebdSchin "memlock", "locked address space", RLIMIT_MEMLOCK, 0, 'l', LIM_KBYTE, 46da2e3ebdSchin "nofile", "number of open files", RLIMIT_NOFILE, "OPEN_MAX", 'n', LIM_COUNT, 47da2e3ebdSchin "nproc", "number of processes", RLIMIT_NPROC, "CHILD_MAX", 'u', LIM_COUNT, 48da2e3ebdSchin "pipe", "pipe buffer size", RLIMIT_PIPE, "PIPE_BUF", 'p', LIM_BYTE, 49da2e3ebdSchin "rss", "resident set size", RLIMIT_RSS, 0, 'm', LIM_KBYTE, 50da2e3ebdSchin "sbsize", "socket buffer size", RLIMIT_SBSIZE, "PIPE_BUF", 'b', LIM_BYTE, 51da2e3ebdSchin "stack", "stack size", RLIMIT_STACK, 0, 's', LIM_KBYTE, 52da2e3ebdSchin "threads", "number of threads", RLIMIT_PTHREAD, "THREADS_MAX", 'T', LIM_COUNT, 53da2e3ebdSchin "vmem", "process size", RLIMIT_VMEM, 0, 'v', LIM_KBYTE, 54da2e3ebdSchin { 0 } 55da2e3ebdSchin }; 56da2e3ebdSchin 57da2e3ebdSchin #endif 58