]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/include/sys/resource.h
Throughout, update copyrights to reflect dates which correspond to main-branch
[newlib-cygwin.git] / winsup / cygwin / include / sys / resource.h
CommitLineData
a887211b
CV
1/* sys/resource.h
2
bc837d22 3 Copyright 1997, 1998, 2000, 2001, 2005 Red Hat, Inc.
a887211b
CV
4
5This file is part of Cygwin.
6
7This software is a copyrighted work licensed under the terms of the
8Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9details. */
10
1fd5e000
CF
11#ifndef _SYS_RESOURCE_H_
12#define _SYS_RESOURCE_H_
13
14#include <sys/time.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
72c1491b
CV
20/* Used for get/setpriority */
21#define PRIO_PROCESS 0
22#define PRIO_PGRP 1
23#define PRIO_USER 2
24
8a93913d
CV
25#define RLIMIT_CPU 0 /* CPU time in seconds */
26#define RLIMIT_FSIZE 1 /* Maximum filesize */
27#define RLIMIT_DATA 2 /* max data size */
28#define RLIMIT_STACK 3 /* max stack size */
29#define RLIMIT_CORE 4 /* max core file size */
30#define RLIMIT_NOFILE 5 /* max number of open files */
31#define RLIMIT_OFILE RLIMIT_NOFILE /* BSD name */
32#define RLIMIT_AS 6 /* address space (virt. memory) limit */
33
44e6d951 34#define RLIMIT_NLIMITS 7 /* upper bound of RLIMIT_* defines */
83443511 35#define RLIM_NLIMITS RLIMIT_NLIMITS
44e6d951 36
8a93913d
CV
37#define RLIM_INFINITY (0xffffffffUL)
38#define RLIM_SAVED_MAX RLIM_INFINITY
39#define RLIM_SAVED_CUR RLIM_INFINITY
40
41typedef unsigned long rlim_t;
42
43struct rlimit {
44 rlim_t rlim_cur;
45 rlim_t rlim_max;
46};
47
1fd5e000
CF
48#define RUSAGE_SELF 0 /* calling process */
49#define RUSAGE_CHILDREN -1 /* terminated child processes */
50
51struct rusage {
75a57bf0 52 struct timeval ru_utime; /* user time used */
1fd5e000
CF
53 struct timeval ru_stime; /* system time used */
54 long ru_maxrss;
55 long ru_ixrss; /* XXX: 0 */
56 long ru_idrss; /* XXX: sum of rm_asrss */
57 long ru_isrss; /* XXX: 0 */
9c510edc
CF
58 long ru_minflt; /* any page faults not requiring I/O */
59 long ru_majflt; /* any page faults requiring I/O */
60 long ru_nswap; /* swaps */
61 long ru_inblock; /* block input operations */
62 long ru_oublock; /* block output operations */
63 long ru_msgsnd; /* messages sent */
64 long ru_msgrcv; /* messages received */
65 long ru_nsignals; /* signals received */
66 long ru_nvcsw; /* voluntary context switches */
67 long ru_nivcsw; /* involuntary " */
1fd5e000
CF
68#define ru_last ru_nivcsw
69};
70
8a93913d
CV
71int getrlimit (int __resource, struct rlimit *__rlp);
72int setrlimit (int __resource, const struct rlimit *__rlp);
73
1fd5e000
CF
74int getrusage (int __who, struct rusage *__rusage);
75
72c1491b
CV
76int getpriority (int which, id_t who);
77int setpriority (int which, id_t who, int value);
78
1fd5e000
CF
79#ifdef __cplusplus
80}
81#endif
82
83#endif
84
This page took 0.420267 seconds and 5 git commands to generate.