ksh: build with __EXTENSIONS__ to expose confstr
[unleashed.git] / share / man / man9e / mc_open.9e
blob0194425536999a0ad4a37bcf2a8492c275ae2aa8
1 .\"
2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
5 .\" 1.0 of the CDDL.
6 .\"
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source.  A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
10 .\"
11 .\"
12 .\" Copyright 2016 Joyent, Inc.
13 .\"
14 .Dd Aug 18, 2016
15 .Dt MC_OPEN 9E
16 .Os
17 .Sh NAME
18 .Nm mc_open ,
19 .Nm mc_close
20 .Nd optional device open and close entry points
21 .Sh SYNOPSIS
22 .In sys/mac_provider.h
23 .Ft int
24 .Fo prefix_m_open
25 .Fa "void *driver"
26 .Fc
27 .Ft void
28 .Fo prefix_m_close
29 .Fa "void *driver"
30 .Fc
31 .Sh INTERFACE LEVEL
32 illumos DDI specific
33 .Sh PARAMETERS
34 .Bl -tag -width Fa
35 .It Fa driver
36 A pointer to the driver's private data that was passed in via the
37 .Sy m_pdata
38 member of the
39 .Xr mac_register 9S
40 structure to the
41 .Xr mac_register 9F
42 function.
43 .El
44 .Sh DESCRIPTION
45 The
46 .Fn mc_open
47 and
48 .Fn mc_close
49 entry points are called when the file system node corresponding to the
50 device is opened.
51 Standard device drivers do not need to implement this function and should not
52 define the callback.
53 .Pp
54 The GLDv3 guarantees that calls to the
55 .Fn mc_open
56 and
57 .Fn mc_close
58 entry points are serialized.
59 Only one such call will be issued to the device driver at any time.
60 .Sh RETURN VALUES
61 Upon successful completion, the device driver should return
62 .Sy 0
63 for its
64 .Fn mc_open
65 entry point.
66 Otherwise, it should return a non-zero error number to indicate an error
67 occurred.
68 .Sh SEE ALSO
69 .Xr mac 9E ,
70 .Xr mac_register 9F ,
71 .Xr mac_register 9S