Reduce <sys/queue.h> pollution.

While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only
actually used in code which is conditional on _KERNEL.  Make the #include
itself conditional as well, and fix userland code that uses <sys/queue.h>
for other purposes but relied on <sys/sysctl.h> to bring it in.

MFC after:	1 week
This commit is contained in:
des 2018-05-11 00:01:43 +00:00
parent 06e9cdaa58
commit 58d2db41a5
7 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/blist.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <vm/swap_pager.h>

View File

@ -29,6 +29,7 @@
*/
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <err.h>

View File

@ -38,7 +38,9 @@
#ifndef _SYS_SYSCTL_H_
#define _SYS_SYSCTL_H_
#ifdef _KERNEL
#include <sys/queue.h>
#endif
struct thread;
/*

View File

@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_mib.h>

View File

@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <netinet/in.h>

View File

@ -39,6 +39,7 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itoju
#include <sys/param.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/uio.h>

View File

@ -34,6 +34,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>