From 43e01c2ef41c038be688be9eb6ee2e8e0bf6de24 Mon Sep 17 00:00:00 2001 From: in2 Date: Sat, 23 Mar 2002 09:04:54 +0000 Subject: add CPULIMIT git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@58 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 9b223c23..2e910180 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.14 2002/03/20 05:23:19 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.15 2002/03/23 09:04:54 in2 Exp $ */ #include #include #include @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1004,6 +1005,12 @@ start_client () #if FORCE_PROCESS_REGISTER_FORM int nreg; #endif +#ifdef CPULIMIT + struct rlimit rml; + rml.rlim_cur = CPULIMIT * 60; + rml.rlim_max = CPULIMIT * 60; + setrlimit(RLIMIT_CPU, &rml); +#endif /* system init */ nice (2); /* Ptt: lower priority */ -- cgit v1.2.3