summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/door.h
blob: 7673293bc7e82899d50e0ab7a907685fc9a3169e (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* Declarations of privilege 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_DOOR_H
#define _SYS_DOOR_H

#include <sys/types.h>
#include <sys/isa_defs.h>

#define DOOR_CREATE	0
#define DOOR_REVOKE	1
#define DOOR_INFO	2
#define DOOR_CALL	3
#define DOOR_BIND	6
#define DOOR_UNBIND	7
#define DOOR_UNREFSYS	8
#define DOOR_UCRED	9
#define DOOR_RETURN	10
#define DOOR_GETPARAM	11
#define DOOR_SETPARAM	12

#define DOOR_INVAL	-1
#define DOOR_UNREF_DATA	((void *)1)

#define DOOR_QUERY	-2

#define DOOR_UNREF		0x01
#define DOOR_PRIVATE		0x02
#define DOOR_UNREF_MULTI	0x10
#define DOOR_REFUSE_DESC	0x40
#define DOOR_NO_CANCEL		0x80

#define DOOR_LOCAL	0x04
#define DOOR_REVOKED	0x08
#define DOOR_IS_UNREF	0x20

#define DOOR_CREATE_MASK	(DOOR_UNREF | DOOR_PRIVATE | \
	DOOR_UNREF_MULTI | DOOR_REFUSE_DESC | DOOR_NO_CANCEL)
#define DOOR_KI_CREATE_MASK	(DOOR_UNREF | DOOR_UNREF_MULTI)

#define DOOR_ATTR_MASK	(DOOR_CREATE_MASK | DOOR_LOCAL | DOOR_REVOKED | \
	DOOR_IS_UNREF)

#define DOOR_DESCRIPTOR	0x10000
#define DOOR_RELEASE	0x40000
#define DOOR_DELAY	0x80000
#define DOOR_UNREF_ACTIVE	0x100000

#define DOOR_PARAM_DESC_MAX	1
#define DOOR_PARAM_DATA_MAX	2
#define DOOR_PARAM_DATA_MIN	3

typedef unsigned long long door_ptr_t;
typedef unsigned int door_attr_t;
typedef unsigned long long door_id_t;

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
# pragma pack(4)
#endif

typedef struct door_info
  {
	pid_t di_target;
	door_ptr_t di_proc;
	door_ptr_t di_data;
	door_attr_t di_attributes;
	door_id_t di_uniquifier;
	int di_resv[4];
  } door_info_t;

typedef struct door_desc
  {
	door_attr_t d_attributes;
	union
	  {
		struct
		  {
			int d_descriptor;
			door_id_t d_id;
		  } d_desc;
		int d_resv[5];
	  } d_data;
} door_desc_t;

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
# pragma pack()
#endif

typedef struct door_cred
  {
	uid_t dc_euid;
	gid_t dc_egid;
	uid_t dc_ruid;
	gid_t dc_rgid;
	pid_t dc_pid;
	int dc_resv[4];
  } door_cred_t;

typedef struct door_arg
  {
	char *data_ptr;
	size_t data_size;
	door_desc_t *desc_ptr;
	unsigned int desc_num;
	char *rbuf;
	size_t rsize;
  } door_arg_t;

struct door_results
  {
	void *cookie;
	char *data_ptr;
	size_t data_size;
	door_desc_t *desc_ptr;
	size_t desc_num;
	void (*pc)(void);
	int nservers;
	door_info_t *door_info;
  };

typedef struct door_return_desc
  {
    door_desc_t *desc_ptr;
    unsigned int desc_num;
  } door_return_desc_t;

#endif /* _SYS_DOOR_H */