]> git.saurik.com Git - apple/xnu.git/blame - bsd/miscfs/devfs/devfs.h
xnu-517.3.15.tar.gz
[apple/xnu.git] / bsd / miscfs / devfs / devfs.h
CommitLineData
1c79356b 1/*
9bccf70c 2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
1c79356b
A
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25/*
26 * Copyright 1997,1998 Julian Elischer. All rights reserved.
27 * julian@freebsd.org
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions are
31 * met:
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright notice,
35 * this list of conditions and the following disclaimer in the documentation
36 * and/or other materials provided with the distribution.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
39 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
40 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 * DISCLAIMED. IN NO EVENT SHALL THE HOLDER OR CONTRIBUTORS BE LIABLE FOR
42 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 *
50 * miscfs/devfs/devfs.h
51 */
52
53#ifndef _MISCFS_DEVFS_DEVFS_H_
54#define _MISCFS_DEVFS_DEVFS_H_
55
9bccf70c
A
56#include <sys/appleapiopts.h>
57
58#ifdef __APPLE_API_UNSTABLE
1c79356b
A
59#define DEVFS_CHAR 0
60#define DEVFS_BLOCK 1
61
62__BEGIN_DECLS
63
64/*
65 * Function: devfs_make_node
66 *
67 * Purpose
68 * Create a device node with the given pathname in the devfs namespace.
69 *
70 * Parameters:
71 * dev - the dev_t value to associate
72 * chrblk - block or character device (DEVFS_CHAR or DEVFS_BLOCK)
73 * uid, gid - ownership
74 * perms - permissions
75 * fmt, ... - print format string and args to format the path name
76 * Returns:
77 * A handle to a device node if successful, NULL otherwise.
78 */
79void * devfs_make_node __P((dev_t dev, int chrblk, uid_t uid, gid_t gid,
80 int perms, char *fmt, ...));
81
82/*
83 * Function: devfs_make_link
84 *
85 * Purpose:
86 * Create a link to a previously created device node.
87 *
88 * Returns:
89 * 0 if successful, -1 if failed
90 */
91int devfs_link __P((void * handle, char *fmt, ...));
92
93/*
94 * Function: devfs_remove
95 *
96 * Purpose:
97 * Remove the device node returned by devfs_make_node() along with
98 * any links created with devfs_make_link().
99 */
100void devfs_remove __P((void * handle));
101
102__END_DECLS
9bccf70c 103#endif /* __APPLE_API_UNSTABLE */
1c79356b 104
9bccf70c 105#ifdef __APPLE_API_PRIVATE
1c79356b
A
106/* XXX */
107#define UID_ROOT 0
108#define UID_BIN 3
109#define UID_UUCP 66
110
111/* XXX */
112#define GID_WHEEL 0
113#define GID_KMEM 2
114#define GID_OPERATOR 5
115#define GID_BIN 7
116#define GID_GAMES 13
117#define GID_DIALER 68
9bccf70c 118#endif /* __APPLE_API_PRIVATE */
1c79356b
A
119
120#endif /* !_MISCFS_DEVFS_DEVFS_H_ */