diff --git a/components/newlib/platform_include/sys/dirent.h b/components/newlib/platform_include/sys/dirent.h index 97e4bfed1c..4626ae14d2 100644 --- a/components/newlib/platform_include/sys/dirent.h +++ b/components/newlib/platform_include/sys/dirent.h @@ -42,7 +42,12 @@ struct dirent { #define DT_UNKNOWN 0 #define DT_REG 1 #define DT_DIR 2 - char d_name[256]; /*!< zero-terminated file name */ +#if __BSD_VISIBLE +#define MAXNAMLEN 255 + char d_name[MAXNAMLEN+1]; /*!< zero-terminated file name */ +#else + char d_name[256]; +#endif }; DIR* opendir(const char* name);