]>
git.saurik.com Git - apple/xnu.git/blob - bsd/miscfs/devfs/devfs.h
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright 1997,1998 Julian Elischer. All rights reserved.
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions are
37 * 1. Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * 2. Redistributions in binary form must reproduce the above copyright notice,
40 * this list of conditions and the following disclaimer in the documentation
41 * and/or other materials provided with the distribution.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
44 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
46 * DISCLAIMED. IN NO EVENT SHALL THE HOLDER OR CONTRIBUTORS BE LIABLE FOR
47 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
49 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
50 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * miscfs/devfs/devfs.h
58 #ifndef _MISCFS_DEVFS_DEVFS_H_
59 #define _MISCFS_DEVFS_DEVFS_H_
61 #include <sys/appleapiopts.h>
69 * Function: devfs_make_node
72 * Create a device node with the given pathname in the devfs namespace.
75 * dev - the dev_t value to associate
76 * chrblk - block or character device (DEVFS_CHAR or DEVFS_BLOCK)
77 * uid, gid - ownership
79 * fmt, ... - print format string and args to format the path name
81 * A handle to a device node if successful, NULL otherwise.
83 void * devfs_make_node(dev_t dev
, int chrblk
, uid_t uid
, gid_t gid
,
84 int perms
, const char *fmt
, ...);
86 #ifdef BSD_KERNEL_PRIVATE
88 * Function: devfs_make_link
91 * Create a link to a previously created device node.
94 * 0 if successful, -1 if failed
96 int devfs_link(void * handle
, char *fmt
, ...);
97 #endif /* BSD_KERNEL_PRIVATE */
100 * Function: devfs_remove
103 * Remove the device node returned by devfs_make_node() along with
104 * any links created with devfs_make_link().
106 void devfs_remove(void * handle
);
110 #ifdef __APPLE_API_PRIVATE
119 #define GID_OPERATOR 5
122 #define GID_DIALER 68
123 #endif /* __APPLE_API_PRIVATE */
125 #endif /* !_MISCFS_DEVFS_DEVFS_H_ */