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