8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include "lint.h"
28 #include <sys/types.h>
29 #include <sys/syscall.h>
30 #include <sys/zone.h>
31 #include <sys/priv.h>
32 #include <priv_private.h>
33 #include <zone.h>
34 #include <sys/tsol/label.h>
35 #include <dlfcn.h>
36 #include <stdlib.h>
37 #include <errno.h>
38
39 zoneid_t
40 zone_create(const char *name, const char *root, const struct priv_set *privs,
41 const char *rctls, size_t rctlsz, const char *zfs, size_t zfssz,
42 int *extended_error, int match, int doi, const bslabel_t *label, int flags)
43 {
44 zone_def zd;
45 priv_data_t *d;
46
47 LOADPRIVDATA(d);
223 {
224 return (syscall(SYS_zone, ZONE_ADD_DATALINK, zoneid, linkid));
225 }
226
227 int
228 zone_remove_datalink(zoneid_t zoneid, datalink_id_t linkid)
229 {
230 return (syscall(SYS_zone, ZONE_DEL_DATALINK, zoneid, linkid));
231 }
232
233 int
234 zone_check_datalink(zoneid_t *zoneidp, datalink_id_t linkid)
235 {
236 return (syscall(SYS_zone, ZONE_CHECK_DATALINK, zoneidp, linkid));
237 }
238
239 int
240 zone_list_datalink(zoneid_t zoneid, int *dlnump, datalink_id_t *linkids)
241 {
242 return (syscall(SYS_zone, ZONE_LIST_DATALINK, zoneid, dlnump, linkids));
243 }
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include "lint.h"
28 #include "thr_uberdata.h"
29 #include <sys/types.h>
30 #include <sys/syscall.h>
31 #include <sys/zone.h>
32 #include <sys/priv.h>
33 #include <priv_private.h>
34 #include <zone.h>
35 #include <sys/tsol/label.h>
36 #include <dlfcn.h>
37 #include <stdlib.h>
38 #include <errno.h>
39
40 zoneid_t
41 zone_create(const char *name, const char *root, const struct priv_set *privs,
42 const char *rctls, size_t rctlsz, const char *zfs, size_t zfssz,
43 int *extended_error, int match, int doi, const bslabel_t *label, int flags)
44 {
45 zone_def zd;
46 priv_data_t *d;
47
48 LOADPRIVDATA(d);
224 {
225 return (syscall(SYS_zone, ZONE_ADD_DATALINK, zoneid, linkid));
226 }
227
228 int
229 zone_remove_datalink(zoneid_t zoneid, datalink_id_t linkid)
230 {
231 return (syscall(SYS_zone, ZONE_DEL_DATALINK, zoneid, linkid));
232 }
233
234 int
235 zone_check_datalink(zoneid_t *zoneidp, datalink_id_t linkid)
236 {
237 return (syscall(SYS_zone, ZONE_CHECK_DATALINK, zoneidp, linkid));
238 }
239
240 int
241 zone_list_datalink(zoneid_t zoneid, int *dlnump, datalink_id_t *linkids)
242 {
243 return (syscall(SYS_zone, ZONE_LIST_DATALINK, zoneid, dlnump, linkids));
244 }
245
246 const char *
247 zone_get_nroot()
248 {
249 uberdata_t *udp = curthread->ul_uberdata;
250 return (udp->ub_broot);
251 }
|