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. 51Standard device drivers do not need to implement this function and should not 52define the callback. 53.Pp 54The GLDv3 guarantees that calls to the 55.Fn mc_open 56and 57.Fn mc_close 58entry points are serialized. 59Only one such call will be issued to the device driver at any time. 60.Sh RETURN VALUES 61Upon successful completion, the device driver should return 62.Sy 0 63for its 64.Fn mc_open 65entry point. 66Otherwise, it should return a non-zero error number to indicate an error 67occurred. 68.Sh SEE ALSO 69.Xr mac 9E , 70.Xr mac_register 9F , 71.Xr mac_register 9S 72