|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: * Copyright (c) 1995, 1994, 1993, 1992, 1991, 1990 ! 27: * Open Software Foundation, Inc. ! 28: * ! 29: * Permission to use, copy, modify, and distribute this software and ! 30: * its documentation for any purpose and without fee is hereby granted, ! 31: * provided that the above copyright notice appears in all copies and ! 32: * that both the copyright notice and this permission notice appear in ! 33: * supporting documentation, and that the name of ("OSF") or Open Software ! 34: * Foundation not be used in advertising or publicity pertaining to ! 35: * distribution of the software without specific, written prior permission. ! 36: * ! 37: * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE ! 38: * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ! 39: * FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL OSF BE LIABLE FOR ANY ! 40: * SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ! 41: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ! 42: * ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING ! 43: * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! 44: */ ! 45: /* ! 46: * OSF Research Institute MK6.1 (unencumbered) 1/31/1995 ! 47: */ ! 48: /* ! 49: * Mach Operating System ! 50: * Copyright (c) 1991,1990,1989 Carnegie Mellon University ! 51: * All Rights Reserved. ! 52: * ! 53: * Permission to use, copy, modify and distribute this software and its ! 54: * documentation is hereby granted, provided that both the copyright ! 55: * notice and this permission notice appear in all copies of the ! 56: * software, derivative works or modified versions, and any portions ! 57: * thereof, and that both notices appear in supporting documentation. ! 58: * ! 59: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 60: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 61: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 62: * ! 63: * Carnegie Mellon requests users of this software to return to ! 64: * ! 65: * Software Distribution Coordinator or [email protected] ! 66: * School of Computer Science ! 67: * Carnegie Mellon University ! 68: * Pittsburgh PA 15213-3890 ! 69: * ! 70: * any improvements or extensions that they make and grant Carnegie Mellon ! 71: * the rights to redistribute these changes. ! 72: */ ! 73: /* ! 74: * File: ipc/ipc_right.h ! 75: * Author: Rich Draves ! 76: * Date: 1989 ! 77: * ! 78: * Declarations of functions to manipulate IPC capabilities. ! 79: */ ! 80: ! 81: #ifndef _IPC_IPC_RIGHT_H_ ! 82: #define _IPC_IPC_RIGHT_H_ ! 83: ! 84: #import <mach/features.h> ! 85: ! 86: #include <mach/boolean.h> ! 87: #include <mach/kern_return.h> ! 88: #include <ipc/ipc_port.h> ! 89: #include <ipc/ipc_entry.h> ! 90: ! 91: #define ipc_right_lookup_read ipc_right_lookup_write ! 92: ! 93: /* Find an entry in a space, given the name */ ! 94: extern kern_return_t ipc_right_lookup_write( ! 95: ipc_space_t space, ! 96: mach_port_t name, ! 97: ipc_entry_t *entryp); ! 98: ! 99: /* Translate (space, object) -> (name, entry) */ ! 100: extern boolean_t ipc_right_reverse( ! 101: ipc_space_t space, ! 102: ipc_object_t object, ! 103: mach_port_t *namep, ! 104: ipc_entry_t *entryp); ! 105: ! 106: /* Make a dead-name request, returning the registered send-once right */ ! 107: extern kern_return_t ipc_right_dnrequest( ! 108: ipc_space_t space, ! 109: mach_port_t name, ! 110: boolean_t immediate, ! 111: ipc_port_t notify, ! 112: ipc_port_t *previousp); ! 113: ! 114: /* Cancel a dead-name request and return the send-once right */ ! 115: extern ipc_port_t ipc_right_dncancel( ! 116: ipc_space_t space, ! 117: ipc_port_t port, ! 118: mach_port_t name, ! 119: ipc_entry_t entry); ! 120: ! 121: #define ipc_right_dncancel_macro(space, port, name, entry) \ ! 122: (((entry)->ie_request == 0) ? IP_NULL : \ ! 123: ipc_right_dncancel((space), (port), (name), (entry))) ! 124: ! 125: /* Check if an entry is being used */ ! 126: extern boolean_t ipc_right_inuse( ! 127: ipc_space_t space, ! 128: mach_port_t name, ! 129: ipc_entry_t entry); ! 130: ! 131: /* Check if the port has died */ ! 132: extern boolean_t ipc_right_check( ! 133: ipc_space_t space, ! 134: ipc_port_t port, ! 135: mach_port_t name, ! 136: ipc_entry_t entry); ! 137: ! 138: /* Clean up an entry in a dead space */ ! 139: extern void ipc_right_clean( ! 140: ipc_space_t space, ! 141: mach_port_t name, ! 142: ipc_entry_t entry); ! 143: ! 144: /* Destroy an entry in a space */ ! 145: extern kern_return_t ipc_right_destroy( ! 146: ipc_space_t space, ! 147: mach_port_t name, ! 148: ipc_entry_t entry); ! 149: ! 150: /* Release a send/send-once/dead-name user reference */ ! 151: extern kern_return_t ipc_right_dealloc( ! 152: ipc_space_t space, ! 153: mach_port_t name, ! 154: ipc_entry_t entry); ! 155: ! 156: /* Modify the user-reference count for a right */ ! 157: extern kern_return_t ipc_right_delta( ! 158: ipc_space_t space, ! 159: mach_port_t name, ! 160: ipc_entry_t entry, ! 161: mach_port_right_t right, ! 162: mach_port_delta_t delta); ! 163: ! 164: /* Retrieve information about a right */ ! 165: extern kern_return_t ipc_right_info( ! 166: ipc_space_t space, ! 167: mach_port_t name, ! 168: ipc_entry_t entry, ! 169: mach_port_type_t *typep, ! 170: mach_port_urefs_t *urefsp); ! 171: ! 172: /* Check if a subsequent ipc_right_copyin would succeed */ ! 173: extern boolean_t ipc_right_copyin_check( ! 174: ipc_space_t space, ! 175: mach_port_t name, ! 176: ipc_entry_t entry, ! 177: mach_msg_type_name_t msgt_name); ! 178: ! 179: /* Copyin a capability from a space */ ! 180: extern kern_return_t ipc_right_copyin( ! 181: ipc_space_t space, ! 182: mach_port_t name, ! 183: ipc_entry_t entry, ! 184: mach_msg_type_name_t msgt_name, ! 185: boolean_t deadok, ! 186: ipc_object_t *objectp, ! 187: ipc_port_t *sorightp); ! 188: ! 189: /* Undo the effects of an ipc_right_copyin */ ! 190: extern void ipc_right_copyin_undo( ! 191: ipc_space_t space, ! 192: mach_port_t name, ! 193: ipc_entry_t entry, ! 194: mach_msg_type_name_t msgt_name, ! 195: ipc_object_t object, ! 196: ipc_port_t soright); ! 197: ! 198: /* Copyin two send rights from a space */ ! 199: extern kern_return_t ipc_right_copyin_two( ! 200: ipc_space_t space, ! 201: mach_port_t name, ! 202: ipc_entry_t entry, ! 203: ipc_object_t *objectp, ! 204: ipc_port_t *sorightp); ! 205: ! 206: /* Copyout a capability to a space */ ! 207: extern kern_return_t ipc_right_copyout( ! 208: ipc_space_t space, ! 209: mach_port_t name, ! 210: ipc_entry_t entry, ! 211: mach_msg_type_name_t msgt_name, ! 212: boolean_t overflow, ! 213: ipc_object_t object); ! 214: ! 215: /* Reanme a capability */ ! 216: extern kern_return_t ipc_right_rename( ! 217: ipc_space_t space, ! 218: mach_port_t oname, ! 219: ipc_entry_t oentry, ! 220: mach_port_t nname, ! 221: ipc_entry_t nentry); ! 222: ! 223: #if MACH_IPC_COMPAT ! 224: ! 225: extern kern_return_t ! 226: ipc_right_copyin_compat(/* ipc_space_t, mach_port_t, ipc_entry_t, ! 227: mach_msg_type_name_t, boolean_t, ipc_object_t * */); ! 228: ! 229: extern kern_return_t ! 230: ipc_right_copyin_header(/* ipc_space_t, mach_port_t, ipc_entry_t, ! 231: ipc_object_t *, mach_msg_type_name_t * */); ! 232: ! 233: #endif /* MACH_IPC_COMPAT */ ! 234: ! 235: #endif /* _IPC_IPC_RIGHT_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.