Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  2. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  3. #ifndef __dj_include_sys_resource_h_
  4. #define __dj_include_sys_resource_h_
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  11.  
  12. #ifndef __STRICT_ANSI__
  13.  
  14. #ifndef _POSIX_SOURCE
  15.  
  16. #include <time.h>
  17.  
  18. #define RUSAGE_SELF     0               /* calling process */
  19. #define RUSAGE_CHILDREN -1              /* terminated child processes */
  20.  
  21. struct rusage {
  22.   struct timeval ru_utime;      /* user time used */
  23.   struct timeval ru_stime;      /* system time used */
  24.   long ru_maxrss;               /* integral max resident set size */
  25.   long ru_ixrss;                /* integral shared text memory size */
  26.   long ru_idrss;                /* integral unshared data size */
  27.   long ru_isrss;                /* integral unshared stack size */
  28.   long ru_minflt;               /* page reclaims */
  29.   long ru_majflt;               /* page faults */
  30.   long ru_nswap;                /* swaps */
  31.   long ru_inblock;              /* block input operations */
  32.   long ru_oublock;              /* block output operations */
  33.   long ru_msgsnd;               /* messages sent */
  34.   long ru_msgrcv;               /* messages received */
  35.   long ru_nsignals;             /* signals received */
  36.   long ru_nvcsw;                /* voluntary context switches */
  37.   long ru_nivcsw;               /* involuntary context switches */
  38. };
  39.  
  40. #define RLIMIT_CPU      0       /* cpu time in milliseconds */
  41. #define RLIMIT_FSIZE    1       /* maximum file size */
  42. #define RLIMIT_DATA     2       /* data size */
  43. #define RLIMIT_STACK    3       /* stack size */
  44. #define RLIMIT_CORE     4       /* core file size */
  45. #define RLIMIT_RSS      5       /* resident set size */
  46. #define RLIMIT_MEMLOCK  6       /* locked-in-memory address space */
  47. #define RLIMIT_NPROC    7       /* number of processes */
  48. #define RLIMIT_NOFILE   8       /* number of open files */
  49.  
  50. #define RLIM_NLIMITS    9       /* number of resource limits */
  51. #define RLIM_INFINITY   ((long) ((1UL << 31) - 1UL))
  52.  
  53. struct rlimit {
  54.   long rlim_cur;                /* current (soft) limit */
  55.   long rlim_max;                /* maximum value for rlim_cur */
  56. };
  57.  
  58. int getrusage(int _who, struct rusage *_rusage);
  59. int getrlimit(int _rltype, struct rlimit *_rlimit);
  60. int setrlimit(int _rltype, const struct rlimit *_rlimit);
  61.  
  62. #endif /* !_POSIX_SOURCE */
  63. #endif /* !__STRICT_ANSI__ */
  64. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  65.  
  66. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  67. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  68.  
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72.  
  73. #endif /* !__dj_include_sys_resource_h_ */
  74.