xref: /original-bsd/sys/sys/syscontext.h (revision 8431ec24)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)syscontext.h	7.2 (Berkeley) 07/04/89
18  */
19 
20 #include <user.h>
21 
22 /*
23  * This file defines the context necessary to do a system call.
24  * For the time being it just selects fields from the user structure.
25  */
26 #define syscontext	user
27 
28 #define sc_ap		u_ap
29 #define sc_nd		u_nd
30 #define sc_retval1	u_r.u_rv.R_val1
31 #define sc_retval2	u_r.u_rv.R_val2
32 #define sc_offset	u_r.r_off
33 #define sc_cdir		u_nd.ni_cdir
34 #define sc_rdir		u_nd.ni_rdir
35 #define sc_cred		u_nd.ni_cred
36 #define sc_uid		u_nd.ni_cred->cr_uid
37 #define sc_gid		u_nd.ni_cred->cr_groups[0]
38 #define sc_ruid		u_nd.ni_cred->cr_ruid
39 #define sc_rgid		u_rgid
40 #define sc_groups	u_nd.ni_cred->cr_groups
41 #define sc_ngroups	u_nd.ni_cred->cr_ngroups
42 #define sc_acflag	u_acflag
43 #define sc_cmask	u_cmask
44 #define sc_ofile	u_ofile
45 
46 #define RETURN(value)	{ u.u_error = (value); return; }
47