1 /* 2 reslimit.h - resource limit functions 3 4 Copyright (C) 2002 Arthur de Jong. 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 21 22 #ifndef _RESLIMIT_H 23 #define _RESLIMIT_H 1 24 25 26 #include <unistd.h> 27 #include <sys/time.h> 28 #include <sys/resource.h> 29 30 31 /* the types resources can be */ 32 #define RESTYPE_UNKNOWN -1 33 #define RESTYPE_SIZE 1 34 #define RESTYPE_TIME 2 35 #define RESTYPE_NUM 3 36 37 38 /* return the type of the resource defined by name */ 39 int getresourcetype(const char *name); 40 41 42 /* save the limit to the specified values 43 note: limit will be set only when setreslimits() is called */ 44 void savereslimit(const char *name,rlim_t soft,rlim_t hard); 45 46 47 /* set all the resources defined */ 48 void setreslimits(void); 49 50 51 #endif /* not _RESLIMIT_H */ 52