summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl.h
blob: c9b4c3eb85ba95af55174608af3c387a0e684a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* Declarations of rctl functions and types.
   Copyright (C) 2008 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#ifndef _SYS_RCTL_H
#define _SYS_RCTL_H

#include <features.h>

#define RCTL_LOCAL_NOACTION	0x00000000
#define RCTL_LOCAL_SIGNAL	0x00000001
#define RCTL_LOCAL_DENY		0x00000002
#define RCTL_LOCAL_MAXIMAL	0x80000000
#define RCTL_LOCAL_PROJDB	0x40000000
#define RCTL_LOCAL_ACTION_MASK	0xFFFF0000
#define RCTL_LOCAL_MASK		0xC0000003

#define RCTL_GLOBAL_NOACTION		0x00000000
#define RCTL_GLOBAL_SYSLOG		0x00000001
#define RCTL_GLOBAL_NOBASIC		0x80000000
#define RCTL_GLOBAL_LOWERABLE		0x40000000
#define RCTL_GLOBAL_DENY_ALWAYS		0x20000000
#define RCTL_GLOBAL_DENY_NEVER		0x10000000
#define RCTL_GLOBAL_FILE_SIZE		0x08000000
#define RCTL_GLOBAL_CPU_TIME		0x04000000
#define RCTL_GLOBAL_SIGNAL_NEVER	0x02000000
#define RCTL_GLOBAL_NOLOCALACTION	RCTL_GLOBAL_SIGNAL_NEVER
#define RCTL_GLOBAL_INFINITE		0x01000000
#define RCTL_GLOBAL_UNOBSERVABLE	0x00800000
#define RCTL_GLOBAL_SYSLOG_NEVER	0x00080000
#define RCTL_GLOBAL_BYTES		0x00400000
#define RCTL_GLOBAL_SECONDS		0x00200000
#define RCTL_GLOBAL_COUNT		0x00100000
#define RCTL_GLOBAL_ACTION_MASK		0xFFFF0000
#define RCTL_GLOBAL_MASK		0xFFF80001

#define RCTL_FIRST	0x00000000
#define RCTL_NEXT	0x00000001
#define RCTL_USAGE	0x00000002

#define RCTL_INSERT	0x00000000
#define RCTL_DELETE	0x00000001
#define RCTL_REPLACE	0x00000002

#define RCTL_USE_RECIPIENT_PID  0x10000000

#define RCTLSYS_ACTION_MASK	0xFFFF0000
#define RCTLSYS_MASK		0x10000003

#define RCPRIV_BASIC		0x01000000
#define RCPRIV_PRIVILEGED	0x04000000
#define RCPRIV_SYSTEM		0x07000000

typedef enum
  {
    RCENTITY_PROCESS,
    RCENTITY_TASK,
    RCENTITY_PROJECT,
    RCENTITY_ZONE
  } rctl_entity_t;
#define RC_MAX_ENTITY	RCENTITY_ZONE

typedef unsigned long long rctl_qty_t;
typedef int rctl_priv_t;
typedef struct rctlblk rctlblk_t;
typedef struct rctl_set rctl_set_t;

__BEGIN_DECLS

int setrctl (const char *controlname, rctlblk_t *old_blk, rctlblk_t *new_blk,
    unsigned int flags);

int getrctl (const char *controlname, rctlblk_t *old_blk, rctlblk_t *new_blk,
    unsigned int flags);

__END_DECLS

#endif /* _SYS_RCTL_H */