close.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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"
/*
* Interface to close a tnfctl handle
*/
#include "tnfctl_int.h"
#include "kernel_int.h"
#include "dbg.h"
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
/* for bug 1253419 - guard against multiple tracing */
extern mutex_t _tnfctl_internalguard_lock;
/*
* Close a tnfctl handle - close any open fds and free up any memory
* that was allocated.
*/
{
return (TNFCTL_ERR_NONE);
if (prexstat)
return (prexstat);
}
}
/* free probe handles */
/* call the destructor function for client probe data */
if (hdl->destroy_func)
}
/* indirect, internal, or kernel mode */
return (TNFCTL_ERR_NONE);
}
/* DIRECT_MODE */
return (TNFCTL_ERR_NONE);
}
switch (action) {
case TNFCTL_TARG_DEFAULT:
break;
case TNFCTL_TARG_KILL:
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
break;
case TNFCTL_TARG_RESUME:
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
break;
case TNFCTL_TARG_SUSPEND:
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
if (prbstat)
return (_tnfctl_map_to_errcode(prbstat));
break;
default:
return (TNFCTL_ERR_BADARG);
}
return (_tnfctl_map_to_errcode(prbstat));
}
{
return (TNFCTL_ERR_NONE);
}
{
if (prexstat) {
return (prexstat);
}
if (prbstat) {
return (_tnfctl_map_to_errcode(prbstat));
}
return (TNFCTL_ERR_NONE);
}