libutil++  1.9.3
 All Classes Functions Variables
ResourceLimit.h
1 /*
2 ** libutil++
3 ** $Id: ResourceLimit.h 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 #ifndef __libutilxx__sella__util__ResourceLimit_H__
10 #define __libutilxx__sella__util__ResourceLimit_H__
11 
12 #include "../../common.h"
13 #include "ResourceLimitException.h"
14 
15 #include <unistd.h>
16 #include <sys/types.h>
17 
18 #include <string>
19 #include <memory>
20 
21 namespace sella {
22  namespace util {
23  class ResourceLimit;
24  }
25 }
26 
28  public:
29  enum Type { Soft = 0, Hard, Both, SOFT = Soft, HARD = Hard, BOTH = Both };
30 
31  public:
32  static void setCoredumpSize(unsigned long size = 0, Type type = Both) throw (ResourceLimitException);
33  static void setFileDescriptors(unsigned long limit = 1024, Type type = Both) throw (ResourceLimitException);
34 
35  static unsigned long getCoredumpSize(Type type = Soft) throw (ResourceLimitException);
36  static unsigned long getFileDescriptors(Type type = Soft) throw (ResourceLimitException);
37 };
38 
39 #endif
40 
41 /*
42 ** vim: noet ts=3 sw=3
43 */