common.c revision 570de38f63910201fdd77246630b7aa8f9dc5661
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <kstat.h>
#include <signal.h>
#include <setjmp.h>
#include "sdbc_stats.h"
#include "report.h"
#include "common.h"
static sigjmp_buf env;
static sig_atomic_t sig_raised = 0;
static void sig_handler(int);
void
sig_handler(int sig)
{
switch (sig) {
case SIGSEGV:
sig_raised = 1;
default:
}
}
/*
* kstat_retrieve() - populate the ks_data field of the kstat_t structure
*
* This function is a user-land equivalent of a ks_snapshot
*
* parameters
* kstat_ctl_t *kc - kstat_ctl_t structure representing returned from
* kstat_open()
* kstat_t *ksp - kstat_t strcture to popluate ks_data into
*
* returns
* NULL pointer on failure
* kstat_t * structure on success
*/
kstat_t *
{
char *end;
int i;
return (NULL);
return (NULL);
/* special handling for variable length string KSTAT_DATA_STRING */
/* catch SIGSEGV (bug 6384130) */
sig_raised = 0;
/* bug 6384130 */
if (sig_raised) {
}
}
}
return (rval);
}
/*
* kstat_value() - retrieve value of a field in a kstat_named_t kstat.
*
* parameters
* kstat_t *ksp - kstat containing the field
* char *name - text string representing the field name
*
* returns
* void * - pointer to data retrieved
*/
void *
{
return (NULL);
case KSTAT_DATA_CHAR :
case KSTAT_DATA_INT32 :
case KSTAT_DATA_UINT32 :
case KSTAT_DATA_INT64 :
case KSTAT_DATA_UINT64 :
case KSTAT_DATA_STRING :
return (KSTAT_NAMED_STR_PTR(knm));
}
return (NULL);
}
/*
* kstat_free() - deallocated memory associated with a kstat
*
* paramters
* kstat_t ksp - kstat to be deallocated
*
* returns
* void
*/
void
{
}
}
{
}