Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man9f/ldi_add_event_handler.9f
Real path: /usr/share/man/man9f/ldi_add_event_handler.9f
Zurück
'\" te .\" Copyright (c) 2007, 2020, Oracle and/or its affiliates. .TH ldi_add_event_handler 9F "30 Sept 2016" "Oracle Solaris 11.4" "Kernel Functions" .SH NAME ldi_add_event_handler \- add NDI event service callback handler .SH SYNOPSIS .LP .nf #include <sys/ddi_obsolete.h> \fBint\fR \fBldi_add_event_handler\fR(\fBldi_handle_t\fR \fIlh\fR, \fIddi_eventcookie_t ec\fR, \fBvoid (*handler)(\fR\fIldi_handle_t\fR, \fIddi_eventcookie_t\fR, \fBvoid *, void *) void *arg,\fR \fIldi_callback_id_t *id\fR); .fi .SH INTERFACE LEVEL .sp .LP Obsolete .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIldi_handle_t lh\fR\fR .ad .br .sp .6 .RS 4n Layered handle representing event notification device. .RE .sp .ne 2 .mk .na \fB\fIddi_eventcookie_t ec\fR\fR .ad .br .sp .6 .RS 4n Cookie returned from call to \fBldi_get_eventcookie\fR(9F). .RE .sp .ne 2 .mk .na \fB\fIvoid (*handler)(ldi_handle_t, ddi_eventcookie_t, void *, void *)\fR\fR .ad .br .sp .6 .RS 4n Callback handler for NDI event service notification. .RE .sp .ne 2 .mk .na \fB\fIvoid *arg\fR\fR .ad .br .sp .6 .RS 4n Pointer to opaque data supplied by caller. Typically, this is a pointer to the layered driver's softstate structure. .RE .sp .ne 2 .mk .na \fB\fIldi_callback_id_t *id\fR\fR .ad .br .sp .6 .RS 4n Pointer to registration id, where a unique registration id is returned. Registration id must be saved and used when calling \fBldi_remove_event_handler\fR(9F) to unregister a callback handler. .RE .SH DESCRIPTION .sp .LP This function is obsolete and is only maintained for compatibility. Use of this function is strongly discouraged. For equivalent functionality provided by new interfaces, see \fBldi_ev_get_cookie\fR(9F) and \fBldi_ev_register_callbacks\fR(9F). .sp .LP The \fBldi_add_event_handler()\fR function adds a callback handler to be invoked at the occurrence of the event specified by the cookie. Adding a callback handler is also known as subscribing to an event. Upon successful subscription, the handler is invoked when the event occurs. You can unregister the handler by using \fBldi_remove_event_handler\fR(9F). .sp .LP An instance of a layered driver can register multiple handlers for an event or a single handler for multiple events. Callback order is not defined and should be assumed to be random. .sp .LP The routine handler is invoked with the following arguments: .sp .ne 2 .mk .na \fB\fBldi_handle_t\fR \fIlh\fR\fR .ad .RS 24n .rt Layered handle representing the device for which the event notification is requested. .RE .sp .ne 2 .mk .na \fB\fBddi_eventcookie_t\fR \fIec\fR\fR .ad .RS 24n .rt Structure describing event that occurred. .RE .sp .ne 2 .mk .na \fB\fBvoid *\fR\fIarg\fR\fR .ad .RS 24n .rt Opaque data pointer provided by the driver during callback registration. .RE .sp .ne 2 .mk .na \fB\fBvoid *\fR\fIimpl_data\fR\fR .ad .RS 24n .rt Pointer to event specific data defined by the framework that invokes the callback function. .RE .SH RETURN VALUES .sp .ne 2 .mk .na \fB\fBDDI_SUCCESS\fR\fR .ad .RS 15n .rt Callback handler registered successfully. .RE .sp .ne 2 .mk .na \fB\fBDDI_FAILURE\fR\fR .ad .RS 15n .rt Failed to register callback handler. Possible reasons include lack of resources or a bad cookie. .RE .SH CONTEXT .sp .LP The \fBldi_add_event_handler()\fR function can be called from user and kernel contexts only. .SH SEE ALSO .sp .LP \fBldi_ev_get_cookie\fR(9F), \fBldi_ev_register_callbacks\fR(9F), \fBldi_get_eventcookie\fR(9F), \fBldi_remove_event_handler\fR(9F) .sp .LP \fIWriting Device Drivers in Oracle Solaris 11.4\fR .SH NOTES .sp .LP Layered drivers must remove all registered callback handlers for a device instance, represented by the layered handle, by calling \fBldi_remove_event_handler\fR(9F) before the layered driver's \fBdetach(9E)\fR routine completes.