2012-02-11 19:31:25 +01:00
|
|
|
#ifndef _SYS_RESOURCE_H_
|
|
|
|
#define _SYS_RESOURCE_H_
|
2005-07-01 11:59:49 +02:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
#include <sys/featuretest.h>
|
|
|
|
#include <sys/time.h>
|
2005-07-01 11:59:49 +02:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
/*
|
|
|
|
* Process priority specifications to get/setpriority.
|
|
|
|
*/
|
|
|
|
#define PRIO_MIN -20
|
|
|
|
#define PRIO_MAX 20
|
2005-07-01 11:59:49 +02:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
#define PRIO_PROCESS 0
|
|
|
|
#define PRIO_PGRP 1
|
|
|
|
#define PRIO_USER 2
|
2009-12-07 20:56:40 +01:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
/*
|
|
|
|
* Resource limits
|
|
|
|
*/
|
|
|
|
#define RLIMIT_CORE 1
|
|
|
|
#define RLIMIT_CPU 2
|
|
|
|
#define RLIMIT_DATA 3
|
|
|
|
#define RLIMIT_FSIZE 4
|
|
|
|
#define RLIMIT_NOFILE 5
|
|
|
|
#define RLIMIT_STACK 6
|
|
|
|
#define RLIMIT_AS 7
|
|
|
|
#define RLIMIT_VMEM RLIMIT_AS /* common alias */
|
2009-12-07 20:56:40 +01:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
#if defined(_NETBSD_SOURCE)
|
|
|
|
#define RLIM_NLIMITS 8 /* number of resource limits */
|
|
|
|
#endif
|
2009-12-07 20:56:40 +01:00
|
|
|
|
|
|
|
#define RLIM_INFINITY ((rlim_t) -1)
|
|
|
|
#define RLIM_SAVED_CUR RLIM_INFINITY
|
|
|
|
#define RLIM_SAVED_MAX RLIM_INFINITY
|
|
|
|
|
|
|
|
struct rlimit
|
|
|
|
{
|
|
|
|
rlim_t rlim_cur;
|
|
|
|
rlim_t rlim_max;
|
|
|
|
};
|
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
#include <sys/cdefs.h>
|
2009-12-07 20:56:40 +01:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
__BEGIN_DECLS
|
|
|
|
int getpriority(int, int);
|
|
|
|
int getrlimit(int, struct rlimit *);
|
|
|
|
int setpriority(int, int, int);
|
|
|
|
__END_DECLS
|
2009-12-07 20:56:40 +01:00
|
|
|
|
2012-02-11 19:31:25 +01:00
|
|
|
#endif /* !_SYS_RESOURCE_H_ */
|