Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/devfsadm/i386/lx_link_i386.c
+++ new/usr/src/cmd/devfsadm/i386/lx_link_i386.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 * Copyright 2016 Joyent, Inc.
26 26 */
27 27
28 28 #include <devfsadm.h>
29 29 #include <strings.h>
30 30 #include <stdio.h>
31 31 #include <sys/lx_ptm.h>
32 32 #include <sys/lx_autofs.h>
33 33
34 34 static int lx_ptm(di_minor_t minor, di_node_t node);
35 35 static int lx_autofs(di_minor_t minor, di_node_t node);
36 36 static int lx_systrace(di_minor_t minor, di_node_t node);
37 37
38 38 static devfsadm_create_t lx_create_cbt[] = {
39 39 { "pseudo", "ddi_pseudo", LX_PTM_DRV,
40 40 TYPE_EXACT | DRV_EXACT, ILEVEL_0, lx_ptm },
41 41 { "pseudo", "ddi_pseudo", LX_AUTOFS_NAME,
42 42 TYPE_EXACT | DRV_EXACT, ILEVEL_0, lx_autofs },
43 43 { "pseudo", "ddi_pseudo", "lx_systrace",
44 44 TYPE_EXACT | DRV_EXACT, ILEVEL_0, lx_systrace },
45 45 };
46 46
47 47 DEVFSADM_CREATE_INIT_V0(lx_create_cbt);
48 48
49 49 static int
50 50 lx_ptm(di_minor_t minor, di_node_t node)
51 51 {
52 52 char *mname = di_minor_name(minor);
53 53
54 54 if (strcmp(LX_PTM_MINOR_NODE, mname) == 0)
55 55 (void) devfsadm_mklink("brand/lx/ptmx", node, minor, 0);
56 56
57 57 return (DEVFSADM_CONTINUE);
58 58 }
59 59
60 60 static int
61 61 lx_autofs(di_minor_t minor, di_node_t node)
62 62 {
63 63 char *mname = di_minor_name(minor);
64 64
65 65 if (strcmp(LX_AUTOFS_MINORNAME, mname) == 0)
66 66 (void) devfsadm_mklink("brand/lx/autofs", node, minor, 0);
67 67
68 68 return (DEVFSADM_CONTINUE);
69 69 }
70 70
71 71 static int
72 72 lx_systrace(di_minor_t minor, di_node_t node)
73 73 {
74 74 char *mname = di_minor_name(minor);
75 75 char path[MAXPATHLEN];
76 76
77 77 (void) snprintf(path, sizeof (path), "dtrace/provider/%s", mname);
78 78 (void) devfsadm_mklink(path, node, minor, 0);
79 79
80 80 return (DEVFSADM_CONTINUE);
81 81 }
|
↓ open down ↓ |
81 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX