4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 #include <sys/types.h>
40 pr_getzoneid(struct ps_prochandle
*Pr
)
47 if (Pr
== NULL
) /* no subject process */
51 adp
->arg_value
= 6; /* switch for zone_lookup in zone */
52 adp
->arg_object
= NULL
;
53 adp
->arg_type
= AT_BYVAL
;
54 adp
->arg_inout
= AI_INPUT
;
58 adp
->arg_value
= 0; /* arguement for zone_lookup in zone */
59 adp
->arg_object
= NULL
;
60 adp
->arg_type
= AT_BYVAL
;
61 adp
->arg_inout
= AI_INPUT
;
64 error
= Psyscall(Pr
, &rval
, SYS_zone
, 2, &argd
[0]);
67 errno
= (error
> 0) ? error
: ENOSYS
;
70 return (rval
.sys_rval1
);
74 pr_getprojid(struct ps_prochandle
*Pr
)
81 if (Pr
== NULL
) /* no subject process */
85 adp
->arg_value
= 2; /* switch for getprojid in tasksys */
86 adp
->arg_object
= NULL
;
87 adp
->arg_type
= AT_BYVAL
;
88 adp
->arg_inout
= AI_INPUT
;
91 error
= Psyscall(Pr
, &rval
, SYS_tasksys
, 1, &argd
[0]);
94 errno
= (error
> 0) ? error
: ENOSYS
;
97 return (rval
.sys_rval1
);
101 pr_gettaskid(struct ps_prochandle
*Pr
)
108 if (Pr
== NULL
) /* no subject process */
109 return (gettaskid());
112 adp
->arg_value
= 1; /* switch for gettaskid in tasksys */
113 adp
->arg_object
= NULL
;
114 adp
->arg_type
= AT_BYVAL
;
115 adp
->arg_inout
= AI_INPUT
;
118 error
= Psyscall(Pr
, &rval
, SYS_tasksys
, 1, &argd
[0]);
121 errno
= (error
> 0) ? error
: ENOSYS
;
124 return (rval
.sys_rval1
);
128 pr_settaskid(struct ps_prochandle
*Pr
, projid_t project
, int flags
)
135 if (Pr
== NULL
) /* No subject process */
136 return (settaskid(project
, flags
));
139 adp
->arg_value
= 0; /* switch for settaskid in tasksys */
140 adp
->arg_object
= NULL
;
141 adp
->arg_type
= AT_BYVAL
;
142 adp
->arg_inout
= AI_INPUT
;
146 adp
->arg_value
= project
;
147 adp
->arg_object
= NULL
;
148 adp
->arg_type
= AT_BYVAL
;
149 adp
->arg_inout
= AI_INPUT
;
150 adp
->arg_size
= sizeof (project
);
153 adp
->arg_value
= flags
;
154 adp
->arg_object
= NULL
;
155 adp
->arg_type
= AT_BYVAL
;
156 adp
->arg_inout
= AI_INPUT
;
159 error
= Psyscall(Pr
, &rval
, SYS_tasksys
, 3, &argd
[0]);
162 errno
= (error
> 0) ? error
: ENOSYS
;
165 return (rval
.sys_rval1
);