xref: /csrg-svn/sys/net/bpf_compat.h (revision 63210)
163209Sbostic /*-
263209Sbostic  * Copyright (c) 1992, 1993
363209Sbostic  *	The Regents of the University of California.  All rights reserved.
463209Sbostic  *
563209Sbostic  * %sccs.include.redist.c%
663209Sbostic  *
7*63210Sbostic  *	@(#)bpf_compat.h	8.1 (Berkeley) 06/10/93
863209Sbostic  */
963209Sbostic 
1063209Sbostic /* from: $Header: bpf_compat.h,v 1.1 92/05/22 15:33:20 mccanne Exp $ (LBL) */
1163209Sbostic 
1263209Sbostic /*
1363209Sbostic  * Some hacks for compatibility across SunOS and 4.4BSD.  We emulate malloc
1463209Sbostic  * and free with mbuf clusters.  We store a pointer to the mbuf in the first
1563209Sbostic  * word of the mbuf and return 8 bytes passed the start of data (for double
1663209Sbostic  * word alignment).  We cannot just use offsets because clusters are not at
1763209Sbostic  * a fixed offset from the associated mbuf.  Sorry for this kludge.
1863209Sbostic  */
1963209Sbostic #define malloc(size, type, canwait) bpf_alloc(size, canwait)
2063209Sbostic #define free(cp, type) m_free(*(struct mbuf **)(cp - 8))
2163209Sbostic #define M_WAITOK M_WAIT
2263209Sbostic 
2363209Sbostic /* This mapping works for our purposes. */
2463209Sbostic #define ERESTART EINTR
25