00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _SYS_RESOURCE_H_
00036 #define _SYS_RESOURCE_H_
00037
00038 #include <sys/cdefs.h>
00039 #include <sys/_timeval.h>
00040 #include <sys/_types.h>
00041
00042 #ifdef __SYMBIAN32__
00043 #include <_ansi.h>
00044
00045 #endif
00046
00047
00048
00049 #define PRIO_MIN -20
00050 #define PRIO_MAX 20
00051
00052 #define PRIO_PROCESS 0
00053 #define PRIO_PGRP 1
00054 #define PRIO_USER 2
00055
00056 #ifdef __SYMBIAN32__
00057 enum {
00058 UPPER_LIMIT_PRIORITY_HIGHEST = -20,
00059 LOWER_LIMIT_PRIORITY_HIGHEST = -16,
00060
00061 UPPER_LIMIT_PRIORITY_ABOVE_NORMAL = -15,
00062 LOWER_LIMIT_PRIORITY_ABOVE_NORMAL = -6,
00063
00064 UPPER_LIMIT_PRIORITY_NORMAL = -5,
00065 LOWER_LIMIT_PRIORITY_NORMAL = 4,
00066
00067 UPPER_LIMIT_PRIORITY_BELOW_NORMAL = 5,
00068 LOWER_LIMIT_PRIORITY_BELOW_NORMAL = 14,
00069
00070 UPPER_LIMIT_PRIORITY_LOWEST = 15,
00071 LOWER_LIMIT_PRIORITY_LOWEST = 20
00072 };
00073 #endif
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #define RUSAGE_SELF 0
00084 #define RUSAGE_CHILDREN -1
00085
00086 struct rusage {
00087 struct timeval ru_utime;
00088 struct timeval ru_stime;
00089 long ru_maxrss;
00090 #define ru_first ru_ixrss
00091 long ru_ixrss;
00092 long ru_idrss;
00093 long ru_isrss;
00094 long ru_minflt;
00095 long ru_majflt;
00096 long ru_nswap;
00097 long ru_inblock;
00098 long ru_oublock;
00099 long ru_msgsnd;
00100 long ru_msgrcv;
00101 long ru_nsignals;
00102 long ru_nvcsw;
00103 long ru_nivcsw;
00104 #define ru_last ru_nivcsw
00105 };
00106
00107
00108
00109
00110 #define RLIMIT_CPU 0
00111 #define RLIMIT_FSIZE 1
00112 #define RLIMIT_DATA 2
00113 #define RLIMIT_STACK 3
00114 #define RLIMIT_CORE 4
00115 #define RLIMIT_RSS 5
00116 #define RLIMIT_MEMLOCK 6
00117 #define RLIMIT_NPROC 7
00118 #define RLIMIT_NOFILE 8
00119 #define RLIMIT_SBSIZE 9
00120 #define RLIMIT_VMEM 10
00121 #define RLIMIT_AS RLIMIT_VMEM
00122
00123 #define RLIM_NLIMITS 11
00124
00125 #define RLIM_INFINITY ((rlim_t)(((uint64_t)1 << 63) - 1))
00126
00127
00128
00129
00130
00131
00132
00133 #ifdef _RLIMIT_IDENT
00134 static char *rlimit_ident[] = {
00135 "cpu",
00136 "fsize",
00137 "data",
00138 "stack",
00139 "core",
00140 "rss",
00141 "memlock",
00142 "nproc",
00143 "nofile",
00144 "sbsize",
00145 "vmem",
00146 };
00147 #endif
00148
00149 #ifndef _RLIM_T_DECLARED
00150 typedef __rlim_t rlim_t;
00151 #define _RLIM_T_DECLARED
00152 #endif
00153
00154 struct rlimit {
00155 rlim_t rlim_cur;
00156 rlim_t rlim_max;
00157 };
00158
00159 #if __BSD_VISIBLE
00160
00161 struct orlimit {
00162 __int32_t rlim_cur;
00163 __int32_t rlim_max;
00164 };
00165
00166 struct loadavg {
00167 __fixpt_t ldavg[3];
00168 long fscale;
00169 };
00170
00171 #define CP_USER 0
00172 #define CP_NICE 1
00173 #define CP_SYS 2
00174 #define CP_INTR 3
00175 #define CP_IDLE 4
00176 #define CPUSTATES 5
00177
00178 #endif
00179
00180 #ifdef _KERNEL
00181
00182 extern struct loadavg averunnable;
00183 extern long cp_time[CPUSTATES];
00184
00185 #else
00186
00187 __BEGIN_DECLS
00188
00189 IMPORT_C int getpriority(int, int);
00190 IMPORT_C int setpriority(int, int, int);
00191 __END_DECLS
00192
00193 #endif
00194 #endif