xref: /original-bsd/sys/net/bpf_compat.h (revision 3705696b)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)bpf_compat.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /* from: $Header: bpf_compat.h,v 1.1 92/05/22 15:33:20 mccanne Exp $ (LBL) */
11 
12 /*
13  * Some hacks for compatibility across SunOS and 4.4BSD.  We emulate malloc
14  * and free with mbuf clusters.  We store a pointer to the mbuf in the first
15  * word of the mbuf and return 8 bytes passed the start of data (for double
16  * word alignment).  We cannot just use offsets because clusters are not at
17  * a fixed offset from the associated mbuf.  Sorry for this kludge.
18  */
19 #define malloc(size, type, canwait) bpf_alloc(size, canwait)
20 #define free(cp, type) m_free(*(struct mbuf **)(cp - 8))
21 #define M_WAITOK M_WAIT
22 
23 /* This mapping works for our purposes. */
24 #define ERESTART EINTR
25