Blame src/api/sys_resource.c
|
nsz |
f81126 |
#include <sys/resource.h>
|
|
nsz |
f81126 |
#define T(t) (t*)0;
|
|
nsz |
f81126 |
#define F(t,n) {t *y = &x.;;}
|
|
nsz |
f81126 |
#define C(n) switch(n){case n:;}
|
|
nsz |
f81126 |
static void f()
|
|
nsz |
f81126 |
{
|
|
nsz |
f81126 |
T(rlim_t)
|
|
nsz |
f81126 |
T(struct timeval)
|
|
nsz |
f81126 |
C(PRIO_PROCESS)
|
|
nsz |
f81126 |
C(PRIO_PGRP)
|
|
nsz |
f81126 |
C(PRIO_USER)
|
|
nsz |
f81126 |
C(RLIM_INFINITY)
|
|
nsz |
f81126 |
C(RLIM_SAVED_MAX)
|
|
nsz |
f81126 |
C(RLIM_SAVED_CUR)
|
|
nsz |
f81126 |
C(RUSAGE_SELF)
|
|
nsz |
f81126 |
C(RUSAGE_CHILDREN)
|
|
nsz |
f81126 |
{
|
|
nsz |
f81126 |
struct rlimit x;
|
|
nsz |
f81126 |
F(rlim_t, rlim_cur)
|
|
nsz |
f81126 |
F(rlim_t, rlim_max)
|
|
nsz |
f81126 |
}
|
|
nsz |
f81126 |
{
|
|
nsz |
f81126 |
struct rusage x;
|
|
nsz |
f81126 |
F(struct timeval, ru_utime)
|
|
nsz |
f81126 |
F(struct timeval, ru_stime)
|
|
nsz |
f81126 |
}
|
|
nsz |
f81126 |
C(RLIMIT_CORE)
|
|
nsz |
f81126 |
C(RLIMIT_CPU)
|
|
nsz |
f81126 |
C(RLIMIT_DATA)
|
|
nsz |
f81126 |
C(RLIMIT_FSIZE)
|
|
nsz |
f81126 |
C(RLIMIT_NOFILE)
|
|
nsz |
f81126 |
C(RLIMIT_STACK)
|
|
nsz |
f81126 |
C(RLIMIT_AS)
|
|
nsz |
0ef264 |
{int(*p)(int,id_t) = getpriority;}
|
|
nsz |
0ef264 |
{int(*p)(int,struct rlimit*) = getrlimit;}
|
|
nsz |
0ef264 |
{int(*p)(int,struct rusage*) = getrusage;}
|
|
nsz |
0ef264 |
{int(*p)(int,id_t,int) = setpriority;}
|
|
nsz |
0ef264 |
{int(*p)(int,const struct rlimit*) = setrlimit;}
|
|
nsz |
f81126 |
}
|