nis_mt.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) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <errno.h>
#include <malloc.h>
#include <syslog.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "nis_proc.h"
extern void check_updaters(void);
extern void check_pingers(void);
/*
* We replace the __start_clock() and __stop_clock() functons from libnsl
* with our own versions that provide per-thread clocks.
*/
int
__start_clock(int clk) {
return (FALSE);
return (TRUE);
}
__stop_clock(int clk) {
return (0);
(void) gettimeofday(&now, 0);
if (mics < 0) {
mics += 1000000;
secs -= 1;
}
return (mics);
}
static nis_tsd_t nis_shared_tsd;
static pthread_key_t nis_tsd_key;
void
__nis_tsd_destroy(void *key) {
if (tsd != 0) {
/* Free memory allocated by nis_get_static_storage() */
/* Purge loose ends */
#ifdef NIS_MT_DEBUG
#endif /* NIS_MT_DEBUG */
}
}
}
int
__nis_init_tsd_key(void) {
}
#pragma init(__nis_init_tsd_key)
__nis_get_tsd(void) {
/* No TSD; create it */
/* Initialize TSD */
/* Register TSD */
/* Can't store key; abort */
#ifdef NIS_MT_DEBUG
abort();
#endif /* NIS_MT_DEBUG */
tsd = &nis_shared_tsd;
}
} else {
/* No memory ? */
#ifdef NIS_MT_DEBUG
abort();
#endif /* NIS_MT_DEBUG */
tsd = &nis_shared_tsd;
}
}
return (tsd);
}
void
}
}