/*
 * Linux-fix.h --
 *
 * Copyright 1995 Massachusetts Institute of Technology.  All Rights
 * Reserved.
 * 
 * You are hereby granted a worldwide, irrevocable, paid-up, right and
 * license to use, execute, display, modify, copy and distribute MIT's
 * Modifications, provided that (i) you abide by the terms and
 * conditions of your Transarc AFS License Agreement, and (ii) you do
 * not use the name of MIT in any advertising or publicity without the
 * prior written consent of MIT.  MIT disclaims all liability for your
 * use of MIT's Modifications.  MIT's Modifications are provided "AS
 * IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE OR NONINFRINGEMENT. 
 *
 * This header contains fixes for linux.
 *
 * Created by:	Derek Atkins <warlord@MIT.EDU>
 *
 * $Source: /afs/sipb/project/afs/src/sipb-3.3a/src/afs/RCS/linux_fix.h,v $
 * $Author: warlord $
 *
 */

#ifndef _LINUX_FIX_H
#define _LINUX_FIX_H

#ifndef min
#define min(a, b)	(((a) < (b)) ? (a) : (b))
#endif

#ifndef sparc
#define bcopy(src,dst,len) memmove(dst,src,len)
#endif
#define bzero(b,len) memset(b, 0, len)
#define printf printk
#define uprintf uprintk
#define copyin(src,dst,len) (memcpy_fromfs(((char *)dst),((char *)src),(len)), 0)
#define copyout(src,dst,len) (memcpy_tofs(((char *)dst),((char *)src),(len)), 0)
#define VATTR_NULL(attr) memset(attr, 0, sizeof(*attr))
#define copyinstr(src,dst,len,size) (copyin(src,dst,len), *size=strlen(dst), 0)

#ifndef osi_free
#define osi_free osi_Free
#endif

#ifndef osi_alloc
#define osi_alloc osi_Alloc
#endif

#endif
