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, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 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. 13 * 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] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2003 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 #pragma weak core_set_options = _core_set_options 30 #pragma weak core_get_options = _core_get_options 31 #pragma weak core_set_global_content = _core_set_global_content 32 #pragma weak core_get_global_content = _core_get_global_content 33 #pragma weak core_set_global_path = _core_set_global_path 34 #pragma weak core_get_global_path = _core_get_global_path 35 #pragma weak core_set_default_content = _core_set_default_content 36 #pragma weak core_get_default_content = _core_get_default_content 37 #pragma weak core_set_default_path = _core_set_default_path 38 #pragma weak core_get_default_path = _core_get_default_path 39 #pragma weak core_set_process_content = _core_set_process_content 40 #pragma weak core_get_process_content = _core_get_process_content 41 #pragma weak core_set_process_path = _core_set_process_path 42 #pragma weak core_get_process_path = _core_get_process_path 43 44 #include "synonyms.h" 45 #include <sys/corectl.h> 46 #include <sys/syscall.h> 47 48 int 49 core_set_options(int options) 50 { 51 return (syscall(SYS_corectl, CC_SET_OPTIONS, options)); 52 } 53 54 int 55 core_get_options(void) 56 { 57 return (syscall(SYS_corectl, CC_GET_OPTIONS)); 58 } 59 60 int 61 core_set_global_content(const core_content_t *content) 62 { 63 return (syscall(SYS_corectl, CC_SET_GLOBAL_CONTENT, content)); 64 } 65 66 int 67 core_get_global_content(core_content_t *content) 68 { 69 return (syscall(SYS_corectl, CC_GET_GLOBAL_CONTENT, content)); 70 } 71 72 int 73 core_set_global_path(const char *buf, size_t bufsize) 74 { 75 return (syscall(SYS_corectl, CC_SET_GLOBAL_PATH, buf, bufsize)); 76 } 77 78 int 79 core_get_global_path(char *buf, size_t bufsize) 80 { 81 return (syscall(SYS_corectl, CC_GET_GLOBAL_PATH, buf, bufsize)); 82 } 83 84 int 85 core_set_default_content(const core_content_t *content) 86 { 87 return (syscall(SYS_corectl, CC_SET_DEFAULT_CONTENT, content)); 88 } 89 90 int 91 core_get_default_content(core_content_t *content) 92 { 93 return (syscall(SYS_corectl, CC_GET_DEFAULT_CONTENT, content)); 94 } 95 96 int 97 core_set_default_path(const char *buf, size_t bufsize) 98 { 99 return (syscall(SYS_corectl, CC_SET_DEFAULT_PATH, buf, bufsize)); 100 } 101 102 int 103 core_get_default_path(char *buf, size_t bufsize) 104 { 105 return (syscall(SYS_corectl, CC_GET_DEFAULT_PATH, buf, bufsize)); 106 } 107 108 int 109 core_set_process_content(const core_content_t *content, pid_t pid) 110 { 111 return (syscall(SYS_corectl, CC_SET_PROCESS_CONTENT, content, pid)); 112 } 113 114 int 115 core_get_process_content(core_content_t *content, pid_t pid) 116 { 117 return (syscall(SYS_corectl, CC_GET_PROCESS_CONTENT, content, pid)); 118 } 119 120 int 121 core_set_process_path(const char *buf, size_t bufsize, pid_t pid) 122 { 123 return (syscall(SYS_corectl, CC_SET_PROCESS_PATH, buf, bufsize, pid)); 124 } 125 126 int 127 core_get_process_path(char *buf, size_t bufsize, pid_t pid) 128 { 129 return (syscall(SYS_corectl, CC_GET_PROCESS_PATH, buf, bufsize, pid)); 130 } 131