xref: /openbsd-src/regress/sys/kern/mbuf/mbuftest.c (revision 49a6e16f2c2c8e509184b1f777366d1a6f337e1c)
1*49a6e16fSderaadt /*	$OpenBSD: mbuftest.c,v 1.3 2021/12/13 16:56:49 deraadt Exp $	*/
2ac709611Sjason 
3ac709611Sjason /*
4ac709611Sjason  * Copyright (c) 2003 Jason L. Wright (jason@thought.net)
5ac709611Sjason  * All rights reserved.
6ac709611Sjason  *
7ac709611Sjason  * Redistribution and use in source and binary forms, with or without
8ac709611Sjason  * modification, are permitted provided that the following conditions
9ac709611Sjason  * are met:
10ac709611Sjason  * 1. Redistributions of source code must retain the above copyright
11ac709611Sjason  *    notice, this list of conditions and the following disclaimer.
12ac709611Sjason  * 2. Redistributions in binary form must reproduce the above copyright
13ac709611Sjason  *    notice, this list of conditions and the following disclaimer in the
14ac709611Sjason  *    documentation and/or other materials provided with the distribution.
15ac709611Sjason  * 3. The name of the author may not be used to endorse or promote products
16ac709611Sjason  *    derived from this software without specific prior written permission.
17ac709611Sjason  *
18ac709611Sjason  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19ac709611Sjason  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20ac709611Sjason  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21ac709611Sjason  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
22ac709611Sjason  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23ac709611Sjason  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24ac709611Sjason  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25ac709611Sjason  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26ac709611Sjason  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27ac709611Sjason  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28ac709611Sjason  * POSSIBILITY OF SUCH DAMAGE.
29ac709611Sjason  */
30ac709611Sjason 
31ac709611Sjason /*
32ac709611Sjason  * Verify that sizeof(struct mbuf) is the same as MSIZE.  Because of
33ac709611Sjason  * padding in the structures, this may have to be adjusted.
34ac709611Sjason  */
35ac709611Sjason 
36ac709611Sjason #include <sys/types.h>
37ac709611Sjason #include <sys/mbuf.h>
38ac709611Sjason #include <stdio.h>
39ac709611Sjason #include <err.h>
40ac709611Sjason 
41ac709611Sjason int main(void);
42ac709611Sjason 
43ac709611Sjason int
main(void)44ac709611Sjason main(void)
45ac709611Sjason {
46ac709611Sjason 	if (sizeof(struct mbuf) != MSIZE)
47ac709611Sjason 		err(1, "sizeof mbuf %lu != MSIZE %d",
48ac709611Sjason 		    sizeof(struct mbuf), MSIZE);
49ac709611Sjason 	return (0);
50ac709611Sjason }
51