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