xref: /illumos-gate/usr/src/uts/common/sys/user.h (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _SYS_USER_H
32*7c478bd9Sstevel@tonic-gate #define	_SYS_USER_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
37*7c478bd9Sstevel@tonic-gate #include <sys/signal.h>
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
40*7c478bd9Sstevel@tonic-gate extern "C" {
41*7c478bd9Sstevel@tonic-gate #endif
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate /*
44*7c478bd9Sstevel@tonic-gate  * struct exdata is visible in and out of the kernel. This is because it
45*7c478bd9Sstevel@tonic-gate  * is referenced in <sys/core.h> which doesn't have this kind of magic.
46*7c478bd9Sstevel@tonic-gate  */
47*7c478bd9Sstevel@tonic-gate struct exdata {
48*7c478bd9Sstevel@tonic-gate 	struct vnode	*vp;
49*7c478bd9Sstevel@tonic-gate 	size_t	ux_tsize;	/* text size */
50*7c478bd9Sstevel@tonic-gate 	size_t	ux_dsize;	/* data size */
51*7c478bd9Sstevel@tonic-gate 	size_t	ux_bsize;	/* bss size */
52*7c478bd9Sstevel@tonic-gate 	size_t	ux_lsize;	/* lib size */
53*7c478bd9Sstevel@tonic-gate 	long	ux_nshlibs;	/* number of shared libs needed */
54*7c478bd9Sstevel@tonic-gate 	short	ux_mach;	/* machine type */
55*7c478bd9Sstevel@tonic-gate 	short	ux_mag;		/* magic number MUST be here */
56*7c478bd9Sstevel@tonic-gate 	off_t	ux_toffset;	/* file offset to raw text */
57*7c478bd9Sstevel@tonic-gate 	off_t	ux_doffset;	/* file offset to raw data */
58*7c478bd9Sstevel@tonic-gate 	off_t	ux_loffset;	/* file offset to lib sctn */
59*7c478bd9Sstevel@tonic-gate 	caddr_t	ux_txtorg;	/* start addr of text in mem */
60*7c478bd9Sstevel@tonic-gate 	caddr_t	ux_datorg;	/* start addr of data in mem */
61*7c478bd9Sstevel@tonic-gate 	caddr_t	ux_entloc;	/* entry location */
62*7c478bd9Sstevel@tonic-gate };
63*7c478bd9Sstevel@tonic-gate 
64*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
65*7c478bd9Sstevel@tonic-gate }
66*7c478bd9Sstevel@tonic-gate #endif
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_KMEMUSER)
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate #include <sys/param.h>
71*7c478bd9Sstevel@tonic-gate #include <sys/pcb.h>
72*7c478bd9Sstevel@tonic-gate #include <sys/siginfo.h>
73*7c478bd9Sstevel@tonic-gate #include <sys/resource.h>
74*7c478bd9Sstevel@tonic-gate #include <sys/time.h>
75*7c478bd9Sstevel@tonic-gate #include <sys/auxv.h>
76*7c478bd9Sstevel@tonic-gate #include <sys/errno.h>
77*7c478bd9Sstevel@tonic-gate #include <sys/t_lock.h>
78*7c478bd9Sstevel@tonic-gate #include <sys/refstr.h>
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
81*7c478bd9Sstevel@tonic-gate extern "C" {
82*7c478bd9Sstevel@tonic-gate #endif
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate /*
85*7c478bd9Sstevel@tonic-gate  * Entry in the per-process list of open files.
86*7c478bd9Sstevel@tonic-gate  * Note: only certain fields are copied in flist_grow() and flist_fork().
87*7c478bd9Sstevel@tonic-gate  * This is indicated in brackets in the structure member comments.
88*7c478bd9Sstevel@tonic-gate  */
89*7c478bd9Sstevel@tonic-gate typedef struct uf_entry {
90*7c478bd9Sstevel@tonic-gate 	kmutex_t	uf_lock;	/* per-fd lock [never copied] */
91*7c478bd9Sstevel@tonic-gate 	struct file	*uf_file;	/* file pointer [grow, fork] */
92*7c478bd9Sstevel@tonic-gate 	struct fpollinfo *uf_fpollinfo;	/* poll state [grow] */
93*7c478bd9Sstevel@tonic-gate 	int		uf_refcnt;	/* LWPs accessing this file [grow] */
94*7c478bd9Sstevel@tonic-gate 	int		uf_alloc;	/* right subtree allocs [grow, fork] */
95*7c478bd9Sstevel@tonic-gate 	short		uf_flag;	/* fcntl F_GETFD flags [grow, fork] */
96*7c478bd9Sstevel@tonic-gate 	short		uf_busy;	/* file is allocated [grow, fork] */
97*7c478bd9Sstevel@tonic-gate 	kcondvar_t	uf_wanted_cv;	/* waiting for setf() [never copied] */
98*7c478bd9Sstevel@tonic-gate 	kcondvar_t	uf_closing_cv;	/* waiting for close() [never copied] */
99*7c478bd9Sstevel@tonic-gate 	struct portfd 	*uf_portfd;	/* associated with port [grow] */
100*7c478bd9Sstevel@tonic-gate 	/* Avoid false sharing - pad to coherency granularity (64 bytes) */
101*7c478bd9Sstevel@tonic-gate 	char		uf_pad[64 - sizeof (kmutex_t) - 2 * sizeof (void*) -
102*7c478bd9Sstevel@tonic-gate 		2 * sizeof (int) - 2 * sizeof (short) -
103*7c478bd9Sstevel@tonic-gate 		2 * sizeof (kcondvar_t) - sizeof (struct portfd *)];
104*7c478bd9Sstevel@tonic-gate } uf_entry_t;
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate /*
107*7c478bd9Sstevel@tonic-gate  * Retired file lists -- see flist_grow() for details.
108*7c478bd9Sstevel@tonic-gate  */
109*7c478bd9Sstevel@tonic-gate typedef struct uf_rlist {
110*7c478bd9Sstevel@tonic-gate 	struct uf_rlist	*ur_next;
111*7c478bd9Sstevel@tonic-gate 	uf_entry_t	*ur_list;
112*7c478bd9Sstevel@tonic-gate 	int		ur_nfiles;
113*7c478bd9Sstevel@tonic-gate } uf_rlist_t;
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate /*
116*7c478bd9Sstevel@tonic-gate  * Per-process file information.
117*7c478bd9Sstevel@tonic-gate  */
118*7c478bd9Sstevel@tonic-gate typedef struct uf_info {
119*7c478bd9Sstevel@tonic-gate 	kmutex_t	fi_lock;	/* see below */
120*7c478bd9Sstevel@tonic-gate 	kmutex_t	fi_pad;		/* unused -- remove in next release */
121*7c478bd9Sstevel@tonic-gate 	int		fi_nfiles;	/* number of entries in fi_list[] */
122*7c478bd9Sstevel@tonic-gate 	uf_entry_t *volatile fi_list;	/* current file list */
123*7c478bd9Sstevel@tonic-gate 	uf_rlist_t	*fi_rlist;	/* retired file lists */
124*7c478bd9Sstevel@tonic-gate } uf_info_t;
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate /*
127*7c478bd9Sstevel@tonic-gate  * File list locking.
128*7c478bd9Sstevel@tonic-gate  *
129*7c478bd9Sstevel@tonic-gate  * Each process has a list of open files, fi_list, indexed by fd.
130*7c478bd9Sstevel@tonic-gate  * fi_list is an array of uf_entry_t structures, each with its own lock.
131*7c478bd9Sstevel@tonic-gate  * One might think that the correct way to lock a file descriptor would be:
132*7c478bd9Sstevel@tonic-gate  *
133*7c478bd9Sstevel@tonic-gate  *	ufp = fip->fi_list[fd];
134*7c478bd9Sstevel@tonic-gate  *	mutex_enter(&ufp->uf_lock);
135*7c478bd9Sstevel@tonic-gate  *
136*7c478bd9Sstevel@tonic-gate  * However, that construct is only safe if fi_lock is already held.  If not,
137*7c478bd9Sstevel@tonic-gate  * fi_list can change in the window between loading ufp and entering uf_lock.
138*7c478bd9Sstevel@tonic-gate  * The UF_ENTER() macro deals with this possibility.  UF_ENTER(ufp, fip, fd)
139*7c478bd9Sstevel@tonic-gate  * locks fd and sets ufp to fd's uf_entry.  The locking rules are as follows:
140*7c478bd9Sstevel@tonic-gate  *
141*7c478bd9Sstevel@tonic-gate  * (1) fi_lock protects fi_list and fi_nfiles.  It also protects the
142*7c478bd9Sstevel@tonic-gate  *     uf_alloc and uf_busy fields of every fd's ufp; see fd_find() for
143*7c478bd9Sstevel@tonic-gate  *     details on file descriptor allocation.
144*7c478bd9Sstevel@tonic-gate  *
145*7c478bd9Sstevel@tonic-gate  * (2) UF_ENTER(ufp, fip, fd) locks descriptor fd and sets ufp to point
146*7c478bd9Sstevel@tonic-gate  *     to the uf_entry_t for fd.  UF_ENTER() protects all fields in ufp
147*7c478bd9Sstevel@tonic-gate  *     except uf_alloc and uf_busy.  UF_ENTER(ufp, fip, fd) also prevents
148*7c478bd9Sstevel@tonic-gate  *     ufp->uf_alloc, ufp->uf_busy, fip->fi_list and fip->fi_nfiles from
149*7c478bd9Sstevel@tonic-gate  *     changing.
150*7c478bd9Sstevel@tonic-gate  *
151*7c478bd9Sstevel@tonic-gate  * (3) The lock ordering is (1), (2).
152*7c478bd9Sstevel@tonic-gate  *
153*7c478bd9Sstevel@tonic-gate  * (4) Note that fip->fi_list and fip->fi_nfiles cannot change while *any*
154*7c478bd9Sstevel@tonic-gate  *     file list lock is held.  Thus flist_grow() must acquire all such
155*7c478bd9Sstevel@tonic-gate  *     locks -- fi_lock and every fd's uf_lock -- to install a new file list.
156*7c478bd9Sstevel@tonic-gate  */
157*7c478bd9Sstevel@tonic-gate #define	UF_ENTER(ufp, fip, fd)					\
158*7c478bd9Sstevel@tonic-gate 	for (;;) {						\
159*7c478bd9Sstevel@tonic-gate 		uf_entry_t *_flist = (fip)->fi_list;		\
160*7c478bd9Sstevel@tonic-gate 		ufp = &_flist[fd];				\
161*7c478bd9Sstevel@tonic-gate 		ASSERT((fd) < (fip)->fi_nfiles);		\
162*7c478bd9Sstevel@tonic-gate 		mutex_enter(&ufp->uf_lock);			\
163*7c478bd9Sstevel@tonic-gate 		if (_flist == (fip)->fi_list)			\
164*7c478bd9Sstevel@tonic-gate 			break;					\
165*7c478bd9Sstevel@tonic-gate 		mutex_exit(&ufp->uf_lock);			\
166*7c478bd9Sstevel@tonic-gate 	}
167*7c478bd9Sstevel@tonic-gate 
168*7c478bd9Sstevel@tonic-gate #define	UF_EXIT(ufp)	mutex_exit(&ufp->uf_lock)
169*7c478bd9Sstevel@tonic-gate 
170*7c478bd9Sstevel@tonic-gate #define	PSARGSZ		80	/* Space for exec arguments (used by ps(1)) */
171*7c478bd9Sstevel@tonic-gate #define	MAXCOMLEN	16	/* <= MAXNAMLEN, >= sizeof (ac_comm) */
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate typedef struct {		/* kernel syscall set type */
174*7c478bd9Sstevel@tonic-gate 	uint_t	word[9];	/* space for syscall numbers [1..288] */
175*7c478bd9Sstevel@tonic-gate } k_sysset_t;
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate /*
178*7c478bd9Sstevel@tonic-gate  * __KERN_NAUXV_IMPL is defined as a convenience sizing mechanism
179*7c478bd9Sstevel@tonic-gate  * for the portions of the kernel that care about aux vectors.
180*7c478bd9Sstevel@tonic-gate  *
181*7c478bd9Sstevel@tonic-gate  * Applications that need to know how many aux vectors the kernel
182*7c478bd9Sstevel@tonic-gate  * supplies should use the proc(4) interface to read /proc/PID/auxv.
183*7c478bd9Sstevel@tonic-gate  *
184*7c478bd9Sstevel@tonic-gate  * This value should not be changed in a patch.
185*7c478bd9Sstevel@tonic-gate  */
186*7c478bd9Sstevel@tonic-gate #if defined(__sparc)
187*7c478bd9Sstevel@tonic-gate #define	__KERN_NAUXV_IMPL 19
188*7c478bd9Sstevel@tonic-gate #elif defined(__i386) || defined(__amd64)
189*7c478bd9Sstevel@tonic-gate #define	__KERN_NAUXV_IMPL 21
190*7c478bd9Sstevel@tonic-gate #endif
191*7c478bd9Sstevel@tonic-gate 
192*7c478bd9Sstevel@tonic-gate struct execsw;
193*7c478bd9Sstevel@tonic-gate 
194*7c478bd9Sstevel@tonic-gate /*
195*7c478bd9Sstevel@tonic-gate  * The user structure; one allocated per process.  Contains all the
196*7c478bd9Sstevel@tonic-gate  * per-process data that doesn't need to be referenced while the
197*7c478bd9Sstevel@tonic-gate  * process is swapped.
198*7c478bd9Sstevel@tonic-gate  */
199*7c478bd9Sstevel@tonic-gate typedef	struct	user {
200*7c478bd9Sstevel@tonic-gate 	/*
201*7c478bd9Sstevel@tonic-gate 	 * These fields are initialized at process creation time and never
202*7c478bd9Sstevel@tonic-gate 	 * modified.  They can be accessed without acquiring locks.
203*7c478bd9Sstevel@tonic-gate 	 */
204*7c478bd9Sstevel@tonic-gate 	struct execsw *u_execsw;	/* pointer to exec switch entry */
205*7c478bd9Sstevel@tonic-gate 	auxv_t  u_auxv[__KERN_NAUXV_IMPL]; /* aux vector from exec */
206*7c478bd9Sstevel@tonic-gate 	timestruc_t u_start;		/* hrestime at process start */
207*7c478bd9Sstevel@tonic-gate 	clock_t	u_ticks;		/* lbolt at process start */
208*7c478bd9Sstevel@tonic-gate 	char	u_comm[MAXCOMLEN + 1];	/* executable file name from exec */
209*7c478bd9Sstevel@tonic-gate 	char	u_psargs[PSARGSZ];	/* arguments from exec */
210*7c478bd9Sstevel@tonic-gate 	int	u_argc;			/* value of argc passed to main() */
211*7c478bd9Sstevel@tonic-gate 	uintptr_t u_argv;		/* value of argv passed to main() */
212*7c478bd9Sstevel@tonic-gate 	uintptr_t u_envp;		/* value of envp passed to main() */
213*7c478bd9Sstevel@tonic-gate 
214*7c478bd9Sstevel@tonic-gate 	/*
215*7c478bd9Sstevel@tonic-gate 	 * These fields are protected by p_lock:
216*7c478bd9Sstevel@tonic-gate 	 */
217*7c478bd9Sstevel@tonic-gate 	struct vnode *u_cdir;		/* current directory */
218*7c478bd9Sstevel@tonic-gate 	struct vnode *u_rdir;		/* root directory */
219*7c478bd9Sstevel@tonic-gate 	uint64_t u_mem;			/* accumulated memory usage */
220*7c478bd9Sstevel@tonic-gate 	size_t	u_mem_max;		/* peak RSS (K) */
221*7c478bd9Sstevel@tonic-gate 	mode_t	u_cmask;		/* mask for file creation */
222*7c478bd9Sstevel@tonic-gate 	char	u_acflag;		/* accounting flag */
223*7c478bd9Sstevel@tonic-gate 	char	u_systrap;		/* /proc: any syscall mask bits set? */
224*7c478bd9Sstevel@tonic-gate 	refstr_t *u_cwd;		/* cached string for cwd */
225*7c478bd9Sstevel@tonic-gate 
226*7c478bd9Sstevel@tonic-gate 	k_sysset_t u_entrymask;		/* /proc syscall stop-on-entry mask */
227*7c478bd9Sstevel@tonic-gate 	k_sysset_t u_exitmask;		/* /proc syscall stop-on-exit mask */
228*7c478bd9Sstevel@tonic-gate 	k_sigset_t u_signodefer;	/* signals defered when caught */
229*7c478bd9Sstevel@tonic-gate 	k_sigset_t u_sigonstack;	/* signals taken on alternate stack */
230*7c478bd9Sstevel@tonic-gate 	k_sigset_t u_sigresethand;	/* signals reset when caught */
231*7c478bd9Sstevel@tonic-gate 	k_sigset_t u_sigrestart;	/* signals that restart system calls */
232*7c478bd9Sstevel@tonic-gate 	k_sigset_t u_sigmask[MAXSIG];	/* signals held while in catcher */
233*7c478bd9Sstevel@tonic-gate 	void	(*u_signal[MAXSIG])();	/* Disposition of signals */
234*7c478bd9Sstevel@tonic-gate 
235*7c478bd9Sstevel@tonic-gate 	/*
236*7c478bd9Sstevel@tonic-gate 	 * Resource controls provide the backend for process resource limits,
237*7c478bd9Sstevel@tonic-gate 	 * the interfaces for which are maintained for compatibility.  To
238*7c478bd9Sstevel@tonic-gate 	 * preserve the behaviour associated with the RLIM_SAVED_CUR and
239*7c478bd9Sstevel@tonic-gate 	 * RLIM_SAVED_MAX tokens, we retain the "saved" rlimits.
240*7c478bd9Sstevel@tonic-gate 	 */
241*7c478bd9Sstevel@tonic-gate 	struct rlimit64	u_saved_rlimit[RLIM_NSAVED];
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate 	uf_info_t	u_finfo;	/* open file information */
244*7c478bd9Sstevel@tonic-gate } user_t;
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate #include <sys/proc.h>			/* cannot include before user defined */
247*7c478bd9Sstevel@tonic-gate 
248*7c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
249*7c478bd9Sstevel@tonic-gate #define	u	(curproc->p_user)	/* user is now part of proc structure */
250*7c478bd9Sstevel@tonic-gate #define	P_FINFO(p)	(&(p)->p_user.u_finfo)
251*7c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
252*7c478bd9Sstevel@tonic-gate 
253*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
254*7c478bd9Sstevel@tonic-gate }
255*7c478bd9Sstevel@tonic-gate #endif
256*7c478bd9Sstevel@tonic-gate 
257*7c478bd9Sstevel@tonic-gate #else	/* defined(_KERNEL) || defined(_KMEMUSER) */
258*7c478bd9Sstevel@tonic-gate 
259*7c478bd9Sstevel@tonic-gate /*
260*7c478bd9Sstevel@tonic-gate  * Here, we define a fake version of struct user for programs
261*7c478bd9Sstevel@tonic-gate  * (debuggers) that use ptrace() to read and modify the saved
262*7c478bd9Sstevel@tonic-gate  * registers directly in the u-area.  ptrace() has been removed
263*7c478bd9Sstevel@tonic-gate  * from the operating system and now exists as a library function
264*7c478bd9Sstevel@tonic-gate  * in libc, built on the /proc process filesystem.  The ptrace()
265*7c478bd9Sstevel@tonic-gate  * library function provides access only to the members of the
266*7c478bd9Sstevel@tonic-gate  * fake struct user defined here.
267*7c478bd9Sstevel@tonic-gate  *
268*7c478bd9Sstevel@tonic-gate  * User-level programs that must know the real contents of struct
269*7c478bd9Sstevel@tonic-gate  * user will have to define _KMEMUSER before including <sys/user.h>.
270*7c478bd9Sstevel@tonic-gate  * Such programs also become machine specific. Carefully consider
271*7c478bd9Sstevel@tonic-gate  * the consequences of your actions.
272*7c478bd9Sstevel@tonic-gate  */
273*7c478bd9Sstevel@tonic-gate 
274*7c478bd9Sstevel@tonic-gate #include <sys/regset.h>
275*7c478bd9Sstevel@tonic-gate 
276*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
277*7c478bd9Sstevel@tonic-gate extern "C" {
278*7c478bd9Sstevel@tonic-gate #endif
279*7c478bd9Sstevel@tonic-gate 
280*7c478bd9Sstevel@tonic-gate #define	PSARGSZ		80	/* Space for exec arguments (used by ps(1)) */
281*7c478bd9Sstevel@tonic-gate 
282*7c478bd9Sstevel@tonic-gate typedef	struct	user {
283*7c478bd9Sstevel@tonic-gate 	gregset_t	u_reg;		/* user's saved registers */
284*7c478bd9Sstevel@tonic-gate 	greg_t		*u_ar0;		/* address of user's saved R0 */
285*7c478bd9Sstevel@tonic-gate 	char	u_psargs[PSARGSZ];	/* arguments from exec */
286*7c478bd9Sstevel@tonic-gate 	void	(*u_signal[MAXSIG])();	/* Disposition of signals */
287*7c478bd9Sstevel@tonic-gate 	int		u_code;		/* fault code on trap */
288*7c478bd9Sstevel@tonic-gate 	caddr_t		u_addr;		/* fault PC on trap */
289*7c478bd9Sstevel@tonic-gate } user_t;
290*7c478bd9Sstevel@tonic-gate 
291*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
292*7c478bd9Sstevel@tonic-gate }
293*7c478bd9Sstevel@tonic-gate #endif
294*7c478bd9Sstevel@tonic-gate 
295*7c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) || defined(_KMEMUSER) */
296*7c478bd9Sstevel@tonic-gate 
297*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_USER_H */
298