]>
git.saurik.com Git - apple/xnu.git/blob - bsd/miscfs/devfs/devfs.h
88a9efe5475baf4c6d21fbc4610f2c5f3e694a9d
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright 1997,1998 Julian Elischer. All rights reserved.
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions are
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright notice,
33 * this list of conditions and the following disclaimer in the documentation
34 * and/or other materials provided with the distribution.
36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
37 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE HOLDER OR CONTRIBUTORS BE LIABLE FOR
40 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * miscfs/devfs/devfs.h
51 #ifndef _MISCFS_DEVFS_DEVFS_H_
52 #define _MISCFS_DEVFS_DEVFS_H_
54 #include <sys/appleapiopts.h>
62 * Function: devfs_make_node
65 * Create a device node with the given pathname in the devfs namespace.
68 * dev - the dev_t value to associate
69 * chrblk - block or character device (DEVFS_CHAR or DEVFS_BLOCK)
70 * uid, gid - ownership
72 * fmt, ... - print format string and args to format the path name
74 * A handle to a device node if successful, NULL otherwise.
76 void * devfs_make_node(dev_t dev
, int chrblk
, uid_t uid
, gid_t gid
,
77 int perms
, const char *fmt
, ...);
79 #ifdef BSD_KERNEL_PRIVATE
81 * Function: devfs_make_link
84 * Create a link to a previously created device node.
87 * 0 if successful, -1 if failed
89 int devfs_link(void * handle
, char *fmt
, ...);
90 #endif /* BSD_KERNEL_PRIVATE */
93 * Function: devfs_remove
96 * Remove the device node returned by devfs_make_node() along with
97 * any links created with devfs_make_link().
99 void devfs_remove(void * handle
);
103 #ifdef __APPLE_API_PRIVATE
112 #define GID_OPERATOR 5
115 #define GID_DIALER 68
116 #endif /* __APPLE_API_PRIVATE */
118 #endif /* !_MISCFS_DEVFS_DEVFS_H_ */