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:
Dag-Erling Smørgrav 2018-05-11 00:01:43 +00:00
parent c3955757a9
commit 6bff85ff9a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333475
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>