Home | History | Annotate | Download | only in src
      1 /*-
      2  * Copyright (c) 2013, 2015
      3  *	mirabilos <m (at) mirbsd.org>
      4  *
      5  * Provided that these terms and disclaimer and all copyright notices
      6  * are retained or reproduced in an accompanying document, permission
      7  * is granted to deal in this work without restriction, including un-
      8  * limited rights to use, publicly perform, distribute, sell, modify,
      9  * merge, give away, or sublicence.
     10  *
     11  * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
     12  * the utmost extent permitted by applicable law, neither express nor
     13  * implied; without malicious intent or gross negligence. In no event
     14  * may a licensor, author or contributor be held liable for indirect,
     15  * direct, other damage, loss, or other issues arising in any way out
     16  * of dealing in the work, even if advised of the possibility of such
     17  * damage or existence of a defect, except proven that it results out
     18  * of said person's immediate fault when using the work as intended.
     19  */
     20 
     21 @RLIMITS_DEFNS
     22 __RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.3 2015/12/12 21:08:44 tg Exp $");
     23 @RLIMITS_ITEMS
     24 #define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid),
     25 @@
     26 
     27 /* generic options for the ulimit builtin */
     28 
     29 <a|
     30 <H|
     31 <S|
     32 
     33 /* do not use options -H, -S or -a or change the order */
     34 
     35 >t|RLIMIT_CPU
     36 FN("time(cpu-seconds)", RLIMIT_CPU, 1
     37 
     38 >f|RLIMIT_FSIZE
     39 FN("file(blocks)", RLIMIT_FSIZE, 512
     40 
     41 >c|RLIMIT_CORE
     42 FN("coredump(blocks)", RLIMIT_CORE, 512
     43 
     44 >d|RLIMIT_DATA
     45 FN("data(KiB)", RLIMIT_DATA, 1024
     46 
     47 >s|RLIMIT_STACK
     48 FN("stack(KiB)", RLIMIT_STACK, 1024
     49 
     50 >l|RLIMIT_MEMLOCK
     51 FN("lockedmem(KiB)", RLIMIT_MEMLOCK, 1024
     52 
     53 >n|RLIMIT_NOFILE
     54 FN("nofiles(descriptors)", RLIMIT_NOFILE, 1
     55 
     56 >p|RLIMIT_NPROC
     57 FN("processes", RLIMIT_NPROC, 1
     58 
     59 >w|RLIMIT_SWAP
     60 FN("swap(KiB)", RLIMIT_SWAP, 1024
     61 
     62 >T|RLIMIT_TIME
     63 FN("humantime(seconds)", RLIMIT_TIME, 1
     64 
     65 >V|RLIMIT_NOVMON
     66 FN("vnodemonitors", RLIMIT_NOVMON, 1
     67 
     68 >i|RLIMIT_SIGPENDING
     69 FN("sigpending", RLIMIT_SIGPENDING, 1
     70 
     71 >q|RLIMIT_MSGQUEUE
     72 FN("msgqueue(bytes)", RLIMIT_MSGQUEUE, 1
     73 
     74 >M|RLIMIT_AIO_MEM
     75 FN("AIOlockedmem(KiB)", RLIMIT_AIO_MEM, 1024
     76 
     77 >O|RLIMIT_AIO_OPS
     78 FN("AIOoperations", RLIMIT_AIO_OPS, 1
     79 
     80 >C|RLIMIT_TCACHE
     81 FN("cachedthreads", RLIMIT_TCACHE, 1
     82 
     83 >B|RLIMIT_SBSIZE
     84 FN("sockbufsiz(KiB)", RLIMIT_SBSIZE, 1024
     85 
     86 >P|RLIMIT_PTHREAD
     87 FN("threadsperprocess", RLIMIT_PTHREAD, 1
     88 
     89 >e|RLIMIT_NICE
     90 FN("maxnice", RLIMIT_NICE, 1
     91 
     92 >r|RLIMIT_RTPRIO
     93 FN("maxrtprio", RLIMIT_RTPRIO, 1
     94 
     95 >m|ULIMIT_M_IS_RSS
     96 FN("resident-set(KiB)", RLIMIT_RSS, 1024
     97 >m|ULIMIT_M_IS_VMEM
     98 FN("memory(KiB)", RLIMIT_VMEM, 1024
     99 
    100 >v|ULIMIT_V_IS_VMEM
    101 FN("virtual-memory(KiB)", RLIMIT_VMEM, 1024
    102 >v|ULIMIT_V_IS_AS
    103 FN("address-space(KiB)", RLIMIT_AS, 1024
    104 
    105 |RLIMITS_OPTCS
    106