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 #include "lint.h" 28 #include <sys/corectl.h> 29 #include <sys/syscall.h> 30 31 int 32 core_set_options(int options) 33 { 34 return (syscall(SYS_corectl, CC_SET_OPTIONS, options)); 35 } 36 37 int 38 core_get_options(void) 39 { 40 return (syscall(SYS_corectl, CC_GET_OPTIONS)); 41 } 42 43 int 44 core_set_global_content(const core_content_t *content) 45 { 46 return (syscall(SYS_corectl, CC_SET_GLOBAL_CONTENT, content)); 47 } 48 49 int 50 core_get_global_content(core_content_t *content) 51 { 52 return (syscall(SYS_corectl, CC_GET_GLOBAL_CONTENT, content)); 53 } 54 55 int 56 core_set_global_path(const char *buf, size_t bufsize) 57 { 58 return (syscall(SYS_corectl, CC_SET_GLOBAL_PATH, buf, bufsize)); 59 } 60 61 int 62 core_get_global_path(char *buf, size_t bufsize) 63 { 64 return (syscall(SYS_corectl, CC_GET_GLOBAL_PATH, buf, bufsize)); 65 } 66 67 int 68 core_set_default_content(const core_content_t *content) 69 { 70 return (syscall(SYS_corectl, CC_SET_DEFAULT_CONTENT, content)); 71 } 72 73 int 74 core_get_default_content(core_content_t *content) 75 { 76 return (syscall(SYS_corectl, CC_GET_DEFAULT_CONTENT, content)); 77 } 78 79 int 80 core_set_default_path(const char *buf, size_t bufsize) 81 { 82 return (syscall(SYS_corectl, CC_SET_DEFAULT_PATH, buf, bufsize)); 83 } 84 85 int 86 core_get_default_path(char *buf, size_t bufsize) 87 { 88 return (syscall(SYS_corectl, CC_GET_DEFAULT_PATH, buf, bufsize)); 89 } 90 91 int 92 core_set_process_content(const core_content_t *content, pid_t pid) 93 { 94 return (syscall(SYS_corectl, CC_SET_PROCESS_CONTENT, content, pid)); 95 } 96 97 int 98 core_get_process_content(core_content_t *content, pid_t pid) 99 { 100 return (syscall(SYS_corectl, CC_GET_PROCESS_CONTENT, content, pid)); 101 } 102 103 int 104 core_set_process_path(const char *buf, size_t bufsize, pid_t pid) 105 { 106 return (syscall(SYS_corectl, CC_SET_PROCESS_PATH, buf, bufsize, pid)); 107 } 108 109 int 110 core_get_process_path(char *buf, size_t bufsize, pid_t pid) 111 { 112 return (syscall(SYS_corectl, CC_GET_PROCESS_PATH, buf, bufsize, pid)); 113 } 114