Conditionally include <linux/limits.h> and <sys/params.h> on Linux, BSD

<linux/limits.h> should be included conditionally for Linux only, also
SPECNAMELEN used conditionally when the OS is FreeBSD requires to
include <sys/params.h>.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
main
Eleni Maria Stea 2021-06-20 09:33:58 +03:00
parent 8bc56fe0fb
commit f287d1990b
1 changed files with 5 additions and 0 deletions

View File

@ -37,7 +37,12 @@
#include <sys/time.h> #include <sys/time.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#ifdef __linux__
#include <linux/limits.h> #include <linux/limits.h>
#elif __FreeBSD__
/* SPECNAMELEN in FreeBSD is defined here: */
#include <sys/param.h>
#endif
#ifdef MAJOR_IN_MKDEV #ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h> #include <sys/mkdev.h>
#endif #endif