1 /* $NetBSD: darwin_proc.h,v 1.6.38.2 2008/11/01 21:22:25 christos Exp $ */
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _DARWIN_PROC_H_
33 #define _DARWIN_PROC_H_
35 #include <machine/darwin_machdep.h>
41 #define DARWIN_NGROUPS 16
42 gid_t cr_groups
[DARWIN_NGROUPS
];
46 struct darwin_lock__bsd__
{
47 struct darwin_slock lk_interlock
;
51 short lk_exclusivecount
;
52 #undef lk_prio /* Defined in <sys/lock.h> */
55 #undef lk_timo /* Defined in <sys/lock.h> */
57 #undef lk_lockholder /* Defined in <sys/lock.h> */
61 struct darwin_ucred
*pc_ucred
;
69 struct darwin_vmspace
{
82 struct darwin_extern_proc
{
85 struct darwin_proc
*__p_forw
;
86 struct darwin_proc
*__p_back
;
88 struct darwin_timeval __p_starttime
;
90 struct darwin_vmspace
*p_vmspace
;
91 struct darwin_sigacts
*p_sigacts
;
100 mach_boolean_t sigwait
;
108 struct itimerval p_realtimer
;
109 struct darwin_timeval p_rtime
;
114 struct darwin_vnode
*p_tracep
;
116 struct darwin_vnode
*p_textvp
;
118 sigset13_t p_sigmask
;
119 sigset13_t p_sigignore
;
120 sigset13_t p_sigcatch
;
124 #define DARWIN_MAXCOMLEN 16
125 char p_comm
[DARWIN_MAXCOMLEN
+ 1];
126 struct darwin_pgrp
*p_pgrp
;
127 struct darwin_user
*p_addr
;
130 struct darwin_rusage
*p_ru
;
133 struct darwin_kinfo_proc
{
135 * kp_proc is a struct darwin_extern_proc.
136 * Declaring struct darwin_extern_proc here causes an allignement
137 * on a word boundary. We replace it by a char array to avoid that.
140 struct darwin_eproc
{
141 struct darwin_proc
*e_paddr
;
142 struct darwin_session
*e_sess
;
143 struct darwin_pcred e_pcred
;
144 struct darwin_ucred e_ucred
;
145 struct darwin_vmspace e_vm
;
151 struct darwin_session
*e_tsess
;
152 #define DARWIN_WMESGLEN 7
153 char e_wmesg
[DARWIN_WMESGLEN
+ 1];
159 #define DARWIN_EPROC_CTTY 0x01
160 #define DARWIN_EPROC_SLEADER 0x02
161 #define DARWIN_COMAPT_MAXLOGNAME 12
162 char e_login
[DARWIN_COMAPT_MAXLOGNAME
];
167 /* p_flag for Darwin */
168 #define DARWIN_P_ADVLOCK 0x00001
169 #define DARWIN_P_CONTROLT 0x00002
170 #define DARWIN_P_INMEM 0x00004
171 #define DARWIN_P_NOCLDSTOP 0x00008
172 #define DARWIN_P_PPWAIT 0x00010
173 #define DARWIN_P_PROFIL 0x00020
174 #define DARWIN_P_SELECT 0x00040
175 #define DARWIN_P_SINTR 0x00080
176 #define DARWIN_P_SUGID 0x00100
177 #define DARWIN_P_SYSTEM 0x00200
178 #define DARWIN_P_TIMEOUT 0x00400
179 #define DARWIN_P_TRACED 0x00800
180 #define DARWIN_P_WAITED 0x01000
181 #define DARWIN_P_WEXIT 0x02000
182 #define DARWIN_P_EXEC 0x04000
183 #define DARWIN_P_OWEUPC 0x08000
184 #define DARWIN_P_FSTRACE 0x10000
185 #define DARWIN_P_SSTEP 0x20000
186 #define DARWIN_P_WAITING 0x0040000
187 #define DARWIN_P_KDEBUG 0x0080000
188 #define DARWIN_P_TTYSLEEP 0x0100000
189 #define DARWIN_P_REBOOT 0x0200000
190 #define DARWIN_P_TBE 0x0400000
191 #define DARWIN_P_SIGEXC 0x0800000
192 #define DARWIN_P_BTRACE 0x1000000
193 #define DARWIN_P_VFORK 0x2000000
194 #define DARWIN_P_NOATTACH 0x4000000
195 #define DARWIN_P_INVFORK 0x8000000
196 #define DARWIN_P_NOSHLIB 0x10000000
197 #define DARWIN_P_FORCEQUOTA 0x20000000
198 #define DARWIN_P_NOCLDWAIT 0x40000000
200 #endif /* _DARWIN_PROC_H_ */