limits.c revision da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* by AT&T Knowledge Ventures *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* http://www.opensource.org/licenses/cpl1.0.txt *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* David Korn <dgk@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#pragma prototyped
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <ast.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include "ulimit.h"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * This is the list of resouce limits controlled by ulimit
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * This command requires getrlimit(), vlimit(), or ulimit()
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#ifndef _no_ulimit
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst char e_unlimited[] = "unlimited";
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst char* e_units[] = { 0, "block", "byte", "kbyte", "second" };
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst int shtab_units[] = { 1, 512, 1, 1024, 1 };
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst Limit_t shtab_limits[] =
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"as", "address space limit", RLIMIT_AS, 0, 'M', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"core", "core file size", RLIMIT_CORE, 0, 'c', LIM_BLOCK,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"cpu", "cpu time", RLIMIT_CPU, 0, 't', LIM_SECOND,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"data", "data size", RLIMIT_DATA, 0, 'd', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"fsize", "file size", RLIMIT_FSIZE, 0, 'f', LIM_BLOCK,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"locks", "number of file locks", RLIMIT_LOCKS, 0, 'L', LIM_COUNT,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"memlock", "locked address space", RLIMIT_MEMLOCK, 0, 'l', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"nofile", "number of open files", RLIMIT_NOFILE, "OPEN_MAX", 'n', LIM_COUNT,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"nproc", "number of processes", RLIMIT_NPROC, "CHILD_MAX", 'u', LIM_COUNT,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"pipe", "pipe buffer size", RLIMIT_PIPE, "PIPE_BUF", 'p', LIM_BYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"rss", "resident set size", RLIMIT_RSS, 0, 'm', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"sbsize", "socket buffer size", RLIMIT_SBSIZE, "PIPE_BUF", 'b', LIM_BYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"stack", "stack size", RLIMIT_STACK, 0, 's', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"threads", "number of threads", RLIMIT_PTHREAD, "THREADS_MAX", 'T', LIM_COUNT,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"vmem", "process size", RLIMIT_VMEM, 0, 'v', LIM_KBYTE,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{ 0 }
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin};
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif