diff --git a/sys/sys/random.h b/sys/sys/random.h --- a/sys/sys/random.h +++ b/sys/sys/random.h @@ -156,16 +156,18 @@ #define random_harvest_queue_ether(a, b) do {} while (0) #endif /* defined(RANDOM_ENABLE_ETHER) */ +#else /* !_KERNEL */ + +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif + #endif /* _KERNEL */ #define GRND_NONBLOCK 0x1 #define GRND_RANDOM 0x2 #define GRND_INSECURE 0x4 -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 -#include -#endif - __BEGIN_DECLS ssize_t getrandom(void *buf, size_t buflen, unsigned int flags); __END_DECLS diff --git a/sys/sys/select.h b/sys/sys/select.h --- a/sys/sys/select.h +++ b/sys/sys/select.h @@ -49,7 +49,7 @@ typedef __sigset_t sigset_t; #endif -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #else #define __SSP_FORTIFY_LEVEL 0 diff --git a/sys/sys/socket.h b/sys/sys/socket.h --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -685,12 +685,12 @@ #endif /* __BSD_VISIBLE */ +#ifndef _KERNEL + #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #endif -#ifndef _KERNEL - #include __BEGIN_DECLS