resource.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _LINUX_RESOURCE_H
  2. #define _LINUX_RESOURCE_H
  3. #include <linux/time.h>
  4. /*
  5. * Resource control/accounting header file for linux
  6. */
  7. /*
  8. * Definition of struct rusage taken from BSD 4.3 Reno
  9. *
  10. * We don't support all of these yet, but we might as well have them....
  11. * Otherwise, each time we add new items, programs which depend on this
  12. * structure will lose. This reduces the chances of that happening.
  13. */
  14. #define RUSAGE_SELF 0
  15. #define RUSAGE_CHILDREN (-1)
  16. #define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
  17. struct rusage {
  18. struct timeval ru_utime; /* user time used */
  19. struct timeval ru_stime; /* system time used */
  20. long ru_maxrss; /* maximum resident set size */
  21. long ru_ixrss; /* integral shared memory size */
  22. long ru_idrss; /* integral unshared data size */
  23. long ru_isrss; /* integral unshared stack size */
  24. long ru_minflt; /* page reclaims */
  25. long ru_majflt; /* page faults */
  26. long ru_nswap; /* swaps */
  27. long ru_inblock; /* block input operations */
  28. long ru_oublock; /* block output operations */
  29. long ru_msgsnd; /* messages sent */
  30. long ru_msgrcv; /* messages received */
  31. long ru_nsignals; /* signals received */
  32. long ru_nvcsw; /* voluntary context switches */
  33. long ru_nivcsw; /* involuntary " */
  34. };
  35. struct rlimit {
  36. unsigned long rlim_cur;
  37. unsigned long rlim_max;
  38. };
  39. #define PRIO_MIN (-20)
  40. #define PRIO_MAX 20
  41. #define PRIO_PROCESS 0
  42. #define PRIO_PGRP 1
  43. #define PRIO_USER 2
  44. /*
  45. * Limit the stack by to some sane default: root can always
  46. * increase this limit if needed.. 8MB seems reasonable.
  47. */
  48. #define _STK_LIM (8*1024*1024)
  49. /*
  50. * GPG wants 32kB of mlocked memory, to make sure pass phrases
  51. * and other sensitive information are never written to disk.
  52. */
  53. #define MLOCK_LIMIT (8 * PAGE_SIZE)
  54. /*
  55. * Due to binary compatibility, the actual resource numbers
  56. * may be different for different linux versions..
  57. */
  58. #include <asm/resource.h>
  59. #endif