xref: /illumos-gate/usr/src/man/man9e/mc_open.9e (revision 55a13001fbd9772352bc050632ef966a249dc73b)
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
32illumos DDI specific
33.Sh PARAMETERS
34.Bl -tag -width Fa
35.It Fa driver
36A pointer to the driver's private data that was passed in via the
37.Sy m_pdata
38member of the
39.Xr mac_register 9S
40structure to the
41.Xr mac_register 9F
42function.
43.El
44.Sh DESCRIPTION
45The
46.Fn mc_open
47and
48.Fn mc_close
49entry points are called when the file system node corresponding to the
50device is opened. Standard device drivers do not need to implement this
51function and should not define the callback.
52.Pp
53The GLDv3 guarantees that calls to the
54.Fn mc_open
55and
56.Fn mc_close
57entry points are serialized. Only one such call will be issued to the
58device driver at any time.
59.Sh RETURN VALUES
60Upon successful completion, the device driver should return
61.Sy 0
62for its
63.Fn mc_open
64entry point. Otherwise, it should return a non-zero error number to
65indicate an error occurred.
66.Sh SEE ALSO
67.Xr mac 9E ,
68.Xr mac_register 9F ,
69.Xr mac_register 9S
70