resource.h 2.3 KB

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