Index: sys/kern/vfs_lookup.c =================================================================== --- sys/kern/vfs_lookup.c +++ sys/kern/vfs_lookup.c @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -747,6 +748,16 @@ return (0); } +/* + * Various filesystems expect to be able to copy a name component (with length + * bounded by NAME_MAX) into a buffer of size MAXNAMLEN or SPECNAMELEN. Make + * sure that these are all the same size. + */ +_Static_assert(MAXNAMLEN == NAME_MAX, + "MAXNAMLEN and NAME_MAX have different values"); +_Static_assert(SPECNAMELEN == NAME_MAX, + "SPECNAMELEN and NAME_MAX have different values"); + /* * Search a pathname. * This is a very central and rather complicated routine.