Annotation of XNU/osfmk/ipc/ipc_right.h, revision 1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.