1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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 2008 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29#include	"lint.h"
30#include	<sys/corectl.h>
31#include	<sys/syscall.h>
32
33int
34core_set_options(int options)
35{
36	return (syscall(SYS_corectl, CC_SET_OPTIONS, options));
37}
38
39int
40core_get_options(void)
41{
42	return (syscall(SYS_corectl, CC_GET_OPTIONS));
43}
44
45int
46core_set_global_content(const core_content_t *content)
47{
48	return (syscall(SYS_corectl, CC_SET_GLOBAL_CONTENT, content));
49}
50
51int
52core_get_global_content(core_content_t *content)
53{
54	return (syscall(SYS_corectl, CC_GET_GLOBAL_CONTENT, content));
55}
56
57int
58core_set_global_path(const char *buf, size_t bufsize)
59{
60	return (syscall(SYS_corectl, CC_SET_GLOBAL_PATH, buf, bufsize));
61}
62
63int
64core_get_global_path(char *buf, size_t bufsize)
65{
66	return (syscall(SYS_corectl, CC_GET_GLOBAL_PATH, buf, bufsize));
67}
68
69int
70core_set_default_content(const core_content_t *content)
71{
72	return (syscall(SYS_corectl, CC_SET_DEFAULT_CONTENT, content));
73}
74
75int
76core_get_default_content(core_content_t *content)
77{
78	return (syscall(SYS_corectl, CC_GET_DEFAULT_CONTENT, content));
79}
80
81int
82core_set_default_path(const char *buf, size_t bufsize)
83{
84	return (syscall(SYS_corectl, CC_SET_DEFAULT_PATH, buf, bufsize));
85}
86
87int
88core_get_default_path(char *buf, size_t bufsize)
89{
90	return (syscall(SYS_corectl, CC_GET_DEFAULT_PATH, buf, bufsize));
91}
92
93int
94core_set_process_content(const core_content_t *content, pid_t pid)
95{
96	return (syscall(SYS_corectl, CC_SET_PROCESS_CONTENT, content, pid));
97}
98
99int
100core_get_process_content(core_content_t *content, pid_t pid)
101{
102	return (syscall(SYS_corectl, CC_GET_PROCESS_CONTENT, content, pid));
103}
104
105int
106core_set_process_path(const char *buf, size_t bufsize, pid_t pid)
107{
108	return (syscall(SYS_corectl, CC_SET_PROCESS_PATH, buf, bufsize, pid));
109}
110
111int
112core_get_process_path(char *buf, size_t bufsize, pid_t pid)
113{
114	return (syscall(SYS_corectl, CC_GET_PROCESS_PATH, buf, bufsize, pid));
115}
116