Subject : Process Resource Limit Desccription : 다음은 Process Resource limit를 변경하는 Program Source를 기술하였다. 원하는 대로 수정하여 사용하시오. 아래의 예는 file descripter limit를 수정하는 방법을 기술하였다. # vi test-limit ... #include#include #include main (argc, argv) int argc; char **argv; { struct rlimit rl; if (argc < 3) { fprintf (stderr, "Usage: %s soft_limit hard_limit prog [args...]\n", argv[0]); exit (1); } rl.rlim_cur = atoi (argv[1]); /* soft limit */ rl.rlim_max = atoi (argv[2]); /* hard limit */ if (setrlimit (RLIMIT_CPU, &rl) == -1) { perror ("setrlimit"); exit (1); } argv+=3; argc-=3; execvp (argv[0], argv); perror ("exec"); exit (1); } ... # cc -o test-limit test-limit.c # test-limit 64 128 csh <--- Process ^ ^ | | ----------- ----------- soft limit hard limit 위의 예는 file descripter를 예를 들었다. /usr/include/sys/resource.h file을 보면 RLIMIT_CPU /* cpu time in milliseconds */ RLIMIT_FSIZE /* maximum file size */ RLIMIT_DATA /* data size */ RLIMIT_STACK /* stack size */ RLIMIT_CORE /* core file size */ RLIMIT_NOFILE /* file descriptors */ RLIMIT_VMEM /* maximum mapped memory */ Revision History 작성일자 : 96.11.13 작성자 : 이민호 수정일자 : 수정자 :