GETRLIMIT

Section: ¸®´ª½º ÇÁ·Î±×·¡¸Ó ¸Þ´º¾ó (2)
Updated: 1993³â 7¿ù 23ÀÏ
Index
Return to Main Contents
 

À̸§

getrlimit, getrusage, setrlimit - ÀÚ¿ø(resource)ÀÇ Á¦ÇÑ°ª°ú »ç¿ë°ªÀ» ¾Ë¾Æ³»°Å³ª ¼³Á¤ÇÑ´Ù.  

»ç¿ë¹ý

#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

int getrlimit (int resource, struct rlimit *rlim);
int getrusage (int who, struct rusage *usage);
int setrlimit (int resource, const struct rlimit *rlim);  

¼³¸í

getrlimit¿Í setrlimit´Â °¢°¢ ÀÚ¿øÀÇ Á¦ÇÑ°ªµéÀ» ¾Ë¾Æ³»°Å³ª ¼³Á¤ÇÑ´Ù. resource´Â ´ÙÀ½ Áß Çϳª¿©¾ß ÇÑ´Ù:

RLIMIT_CPU     /* ÃÊ ´ÜÀ§ÀÇ CPU ½Ã°£ */

RLIMIT_FSIZE   /* ÃÖ´ë ÆÄÀÏ Å©±â */

RLIMIT_DATA    /* ÃÖ´ë µ¥ÀÌŸ Å©±â */

RLIMIT_STACK   /* ÃÖ´ë ½ºÅà ũ±â */

RLIMIT_CORE    /* ÃÖ´ë ÄÚ¾î ÆÄÀÏ Å©±â */

RLIMIT_RSS     /* ÃÖ´ë °ÅÁÖ ÁýÇÕ Å©±â */

RLIMIT_NPROC   /* ÃÖ´ë ÇÁ·Î¼¼½º ¼ö */

RLIMIT_NOFILE  /* ÃÖ´ë ¿­ ¼ö ÀÖ´Â ÆÄÀÏÀÇ ¼ö */

RLIMIT_MEMLOCK /* ÃÖ´ë Àá±ä ±â¾ï Àå¼Ò ÁÖ¼Ò °ø°£ */

RLIMIT_AS              /* ÁÖ¼Ò °ø°£(°¡»ó ¸Þ¸ð¸®) Á¦ÇÑ°ª */

¸¸ÀÏ RLIM_INFINITY·Î ¼³Á¤µÇ¾ú´Ù¸é ÀÚ¿øÀº ¹«Á¦ÇÑÀÌ´Ù. RLIMIT_OFILE´Â RLIMIT_NOFILE¿¡ ´ëÇÑ BSD À̸§ÀÌ´Ù.

rlimit ±¸Á¶Ã¼´Â ´ÙÀ½°ú °°´Ù:

struct rlimit
{
        rlim_t  rlim_cur;
        rlim_t  rlim_max;
};

getrusage´Â ÇöÀç ÀÚ¿øÀÇ »ç¿ë°ªÀ» ¹ÝȯÇÑ´Ù. who´Â RUSAGE_SELF³ª RUSAGE_CHILDREN Áß ÇϳªÀÌ´Ù.

struct rusage
{
        struct timeval ru_utime;        /* »ç¿ëµÈ »ç¿ëÀÚ ½Ã°£ */
        struct timeval ru_stime;        /* »ç¿ëµÈ ½Ã½ºÅÛ ½Ã°£ */
        long    ru_maxrss;              /* ÃÖ´ë °ÅÁÖ ÁýÇÕ Å©±â */
        long    ru_ixrss;                       /* ÃÑ °øÀ¯ ¸Þ¸ð¸® Å©±â */
        long    ru_idrss;                       /* °øÀ¯µÇÁö ¾ÊÀº ÃÑ µ¥ÀÌŸ Å©±â */
        long    ru_isrss;                       /* °øÀ¯µÇÁö ¾ÊÀº ÃÑ ½ºÅà ũ±â */
        long    ru_minflt;              /* ÆäÀÌÁö ¹Ýȯ(reclaims) */
        long    ru_majflt;              /* ÆäÀÌÁö ÆúÆ® */
        long    ru_nswap;                       /* ½º¿Ò */
        long    ru_inblock;             /* ºí·° ÀÔ·Â ¿¬»ê */
        long    ru_oublock;             /* ºí·° Ãâ·Â ¿¬»ê */
        long    ru_msgsnd;              /* º¸³½ ¸Þ¼¼Áö */
        long    ru_msgrcv;              /* ¹ÞÀº ¸Þ¼¼Áö */
        long    ru_nsignals;            /* ¹ÞÀº ½Ã±×³Î */
        long    ru_nvcsw;                       /* ÀÚ¹ßÀûÀÎ ¹®¸Æ ±³È¯ */
        long    ru_nivcsw;              /* ºñÀÚ¹ßÀûÀÎ ¹®¸Æ ±³È¯ */
};
 

¹Ýȯ°ª

¼º°ø½Ã, 0ÀÌ ¸®ÅϵȴÙ. ¿¡·¯½Ã, -1ÀÌ ¸®ÅϵǸç, errno´Â Àû´çÇÑ °ªÀ¸·Î ¼³Á¤µÈ´Ù.  

¿¡·¯

EFAULT
rlim³ª usage°¡ Á¢±ÙÇÒ ¼ö ¾ø´Â ÁÖ¼Ò °ø°£À» °¡¸®Å°°í ÀÖ´Ù.
EINVAL
getrlimit¶Ç´Â setrlimit°¡ À¯È¿ÇÏÁö ¾ÊÀº resource·Î È£ÃâµÇ¾ú°Å³ª, getrusage°¡ À¯È¿ÇÏÁö ¾ÊÀº who·Î È£ÃâµÇ¾ú´Ù.
EPERM
ºñ-½´ÆÛ À¯Àú°¡ ¼ÒÇÁÆ® Á¦ÇÑ°ª°ú Çϵå Á¦ÇÑ°ªÀ» ÇöÀçÀÇ Çϵå Á¦ÇÑ°ªº¸´Ù ³ôÀº °ªÀ¸·Î Áõ°¡½ÃÅ°±â À§ÇØ setrlimit()¸¦ »ç¿ëÇÏ¿´°Å³ª, ½´ÆÛ À¯Àú°¡ ÇöÀç Ä¿³Î ÃÖ´ë°ªº¸´Ù Å«°ªÀ¸·Î RLIMIT_NOFILEÀ» º¯°æÇÏ·Á°í ½ÃµµÇß´Ù.
 

ȣȯ

SVr4, BSD 4.3  

°ü·Ã Ç׸ñ

ulimit(2), quotactl(2)  

¿ªÀÚ

Á¤°­ÈÆ <skyeyes@soback.kornet.net>, 2000³â 5¿ù 12ÀÏ


 

Index

À̸§
»ç¿ë¹ý
¼³¸í
¹Ýȯ°ª
¿¡·¯
ȣȯ
°ü·Ã Ç׸ñ
¿ªÀÚ

This document was created by man2html, using the manual pages.
Time: 08:06:58 GMT, March 25, 2004