Make UEFI boot-platform build again
[haiku.git] / headers / posix / sys / resource.h
blob96ac924a20a3a8acdf14d808b33fa29e9fa09536
1 /*
2 * Copyright 2003-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _SYS_RESOURCE_H
6 #define _SYS_RESOURCE_H
9 #include <config/types.h>
11 #include <sys/cdefs.h>
12 #include <sys/time.h>
15 /* getrlimit()/setrlimit() definitions */
17 typedef __haiku_addr_t rlim_t;
19 struct rlimit {
20 rlim_t rlim_cur; /* current soft limit */
21 rlim_t rlim_max; /* hard limit */
24 /* ToDo: the only supported mode is RLIMIT_NOFILE right now */
25 #define RLIMIT_CORE 0 /* size of the core file */
26 #define RLIMIT_CPU 1 /* CPU time per team */
27 #define RLIMIT_DATA 2 /* data segment size */
28 #define RLIMIT_FSIZE 3 /* file size */
29 #define RLIMIT_NOFILE 4 /* number of open files */
30 #define RLIMIT_STACK 5 /* stack size */
31 #define RLIMIT_AS 6 /* address space size */
32 /* Haiku-specifics */
33 #define RLIMIT_NOVMON 7 /* number of open vnode monitors */
35 #define RLIM_NLIMITS 8 /* number of resource limits */
37 #define RLIM_INFINITY (0xffffffffUL)
38 #define RLIM_SAVED_MAX RLIM_INFINITY
39 #define RLIM_SAVED_CUR RLIM_INFINITY
42 /* getrusage() definitions */
44 struct rusage {
45 struct timeval ru_utime; /* user time used */
46 struct timeval ru_stime; /* system time used */
49 #define RUSAGE_SELF 0
50 #define RUSAGE_CHILDREN -1
53 /* getpriority()/setpriority() definitions */
55 #define PRIO_PROCESS 0
56 #define PRIO_PGRP 1
57 #define PRIO_USER 2
60 __BEGIN_DECLS
62 extern int getrusage(int who, struct rusage *rusage);
64 extern int getrlimit(int resource, struct rlimit * rlp);
65 extern int setrlimit(int resource, const struct rlimit * rlp);
67 /* ToDo: The following POSIX calls are missing (in BeOS as well):
68 * int getpriority(int which, id_t who);
69 * int setpriority(int which, id_t who, int priority); */
71 __END_DECLS
73 #endif /* _SYS_RESOURCE_H */