xref: /titanic_52/usr/src/lib/libc/port/sys/corectl.c (revision 7257d1b4d25bfac0c802847390e98a464fd787ac)
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 
33 int
34 core_set_options(int options)
35 {
36 	return (syscall(SYS_corectl, CC_SET_OPTIONS, options));
37 }
38 
39 int
40 core_get_options(void)
41 {
42 	return (syscall(SYS_corectl, CC_GET_OPTIONS));
43 }
44 
45 int
46 core_set_global_content(const core_content_t *content)
47 {
48 	return (syscall(SYS_corectl, CC_SET_GLOBAL_CONTENT, content));
49 }
50 
51 int
52 core_get_global_content(core_content_t *content)
53 {
54 	return (syscall(SYS_corectl, CC_GET_GLOBAL_CONTENT, content));
55 }
56 
57 int
58 core_set_global_path(const char *buf, size_t bufsize)
59 {
60 	return (syscall(SYS_corectl, CC_SET_GLOBAL_PATH, buf, bufsize));
61 }
62 
63 int
64 core_get_global_path(char *buf, size_t bufsize)
65 {
66 	return (syscall(SYS_corectl, CC_GET_GLOBAL_PATH, buf, bufsize));
67 }
68 
69 int
70 core_set_default_content(const core_content_t *content)
71 {
72 	return (syscall(SYS_corectl, CC_SET_DEFAULT_CONTENT, content));
73 }
74 
75 int
76 core_get_default_content(core_content_t *content)
77 {
78 	return (syscall(SYS_corectl, CC_GET_DEFAULT_CONTENT, content));
79 }
80 
81 int
82 core_set_default_path(const char *buf, size_t bufsize)
83 {
84 	return (syscall(SYS_corectl, CC_SET_DEFAULT_PATH, buf, bufsize));
85 }
86 
87 int
88 core_get_default_path(char *buf, size_t bufsize)
89 {
90 	return (syscall(SYS_corectl, CC_GET_DEFAULT_PATH, buf, bufsize));
91 }
92 
93 int
94 core_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 
99 int
100 core_get_process_content(core_content_t *content, pid_t pid)
101 {
102 	return (syscall(SYS_corectl, CC_GET_PROCESS_CONTENT, content, pid));
103 }
104 
105 int
106 core_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 
111 int
112 core_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