/*
 *	Copyright (c) 1995, 1996, Sun Microsystems, Inc.
 *
 * This software is provided by Sun ``AS IS'' and any express or implied
 * warranties, including, but not limited to, the implied warranties of
 * merchantability and fitness for a particular purpose are disclaimed.
 * In no event shall Sun Microsystems be liable for any direct, indirect,
 * incidental, special, exemplary, or consequential damages.
 *
 * This software is not a product, and is provided for evaluation purposes
 * only.
 *
 * This software may not be resold without the express permission of
 * Sun Microsystems.
 *
 * Feedback on this tool may be sent to packet-shell-owner@sunroof.eng.sun.com.
 *
 * Packet Shell
 */

#pragma ident	"@(#)psh_compat.c	1.7	98/11/12 SMI"

/*
 * The purpose of this module is binary compatibility with 2.4 and earlier.
 * The difficulty is that, although bcopy and friends are back in libc
 * (where they always belonged), older Solaris systems are still using
 * libc's without it.
 *
 * Unfortunately, /usr/ucblib/libucb.so is no help, since it strongly binds
 * a bunch of other symbols such as readdir() and they behave differently
 * and override the weak binding readdir in libc.  Ugh.
 */
#include <string.h>
#include <sys/types.h>

void
bzero(void *addr, size_t size)
{
	(void) memset(addr, 0, size);
}

void
bcopy(const void *src, void *dst, size_t size)
{
	(void) memcpy(dst, src, size);
}

int
bcmp(const void *s1, const void *s2, size_t len)
{
	return (memcmp(s1, s2, len));
}

#ifdef	STREAMS_EMULATOR
/*
 * This is to force libpthread to be loaded, since in general a dlopen'ed
 * protocol library can't, and at least the STREAMS protocol library wants
 * to.
 *
 * This is #ifdef'ed out by default since it's non-standard code, and not
 * very frequently used right now.  Probably only needed on Solaris.
 */
#include <pthread.h>
__dummy__()
{
	pthread_mutex_unlock(0);
	return (0);
}
#endif /* STREAMS_EMULATOR */
