f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * CDDL HEADER START
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * The contents of this file are subject to the terms of the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Common Development and Distribution License, Version 1.0 only
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * (the "License"). You may not use this file except in compliance
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * with the License.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * See the License for the specific language governing permissions
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * and limitations under the License.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * When distributing Covered Code, include this CDDL HEADER in each
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * If applicable, add the following below this CDDL HEADER, with the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * fields enclosed by brackets "[]" replaced with your own identifying
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * information: Portions Copyright [yyyy] [name of copyright owner]
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * CDDL HEADER END
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * All rights reserved.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby#pragma ident "%Z%%M% %I% %E% SMI"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * syseventd client interfaces
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * sysevent_client.c - contains routines particular to syseventd client
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * management (addition and deletion).
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/* Global client table and lock */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbystruct sysevent_client *sysevent_client_tbl[MAX_SLM];
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * initialize_client_tbl - Initialize each client entry in the syseventd
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * client table. Each entry in the client table
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * entry represents one shared-object (SLM) client.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby for (i = 0; i < MAX_SLM; ++i) {
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby if (mutex_init(&scp->client_lock, USYNC_THREAD, NULL) != 0)
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby /* Clear all flags when setting UNLOADED */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * insert_client - called when a new SLM is loaded with syseventd. The
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * client specific data is updated to reflect this addition
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyinsert_client(void *client_data, int client_type, int retry_limit)
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby for (i = 0; i < MAX_SLM; ++i) {
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby (void) cond_init(&scp->client_cv, USYNC_THREAD,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby syseventd_print(1, "Unable to insert into syseventd client table\n");
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby return (-1);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * delete_client - called to remove an SLM from the client table. Client
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * removal may occur when syseventd terminates, receives
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * a SIGHUP or the client must be force unloaded due
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * it's unresponsive nature.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby /* Clear all flags when setting UNLOADED */