/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Functions to sync up library list with that of the run time linker
*/
#ifndef DEBUG
#endif
#include <assert.h>
#include "tnfctl_int.h"
#include "kernel_int.h"
#include "dbg.h"
{
return (prexstat);
}
/* hndl refers to a process */
/* return value of lmap_ok, dl_evt ignored */
return (prexstat);
}
/*
* _tnfctl_lock_libs() locks the library list maintained in the prex
* handle against it changing by a dlopen or dlclose.
*
* This locking code is between the thread that owns the handle and
* the situation of having multiple threads operating on the same
* handle - in effect the code per tnfctl_handle can be thought of as
* being single-threaded - that is why we can check "hndl->in_objlist"
* without first obtaining a lock. "in_objlist" is the re-entrancy
* protector on the lock i.e. we can call _tnfctl_lock_libs() safely even if
* this thread has the lock held. The return value "release_lock" indicates
* whether the lock should be released or not. It can be passed into
* _tnfctl_unlock_libs() which will do the right thing.
*
* All of this is a bit too complex for warlock. Here we give warlock a
* simpler view, that these routines have the side effect of acquiring and
* releasing the lock, period.
*/
{
#if defined(__lock_lint)
#else
/* this interface is only for INTERNAL_MODE clients */
/*
* already have _tnfctl_lmap_lock held which implies that
* the library list has been sync'ed up
*/
*release_lock = B_FALSE;
return (TNFCTL_ERR_NONE);
}
/* lock is not currently held, so lock it */
*release_lock = B_TRUE;
return (TNFCTL_ERR_NONE);
#endif
}
void
{
#if defined(__lock_lint)
#else
/* this interface is only for INTERNAL_MODE clients */
if (release_lock) {
}
#endif
}
/*
* _tnfctl_syn_lib_list() syncs up the library list maintained
* in the prex handle with the libraries in the process (if needed)
* NOTE: Assumes _tnfctl_lmap_lock is held.
*
*/
{
/* this interface is only for INTERNAL_MODE clients */
/* lmap_lock held and in_objlist marked as B_TRUE */
if (_tnfctl_libs_changed == B_TRUE) {
if (prexstat) {
return (prexstat);
}
}
return (TNFCTL_ERR_NONE);
}