logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

resource.h (2595B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_RESOURCE_H
  3. #define _LINUX_RESOURCE_H
  4. #include <linux/time_types.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 __kernel_old_timeval ru_utime; /* user time used */
  22. struct __kernel_old_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. * Limit the amount of locked memory by some sane default:
  59. * root can always increase this limit if needed.
  60. *
  61. * The main use-cases are (1) preventing sensitive memory
  62. * from being swapped; (2) real-time operations; (3) via
  63. * IOURING_REGISTER_BUFFERS.
  64. *
  65. * The first two don't need much. The latter will take as
  66. * much as it can get. 8MB is a reasonably sane default.
  67. */
  68. #define MLOCK_LIMIT (8*1024*1024)
  69. /*
  70. * Due to binary compatibility, the actual resource numbers
  71. * may be different for different linux versions..
  72. */
  73. #include <asm/resource.h>
  74. #endif /* _LINUX_RESOURCE_H */