lib: posix: Do not redefine PATH_MAX in unistd.h

This constant should be defined in limits.h.  Define it in limits.h in
the minimal libc, and use the definition found in newlib's includes.
Values in newlib includes range from 1024 to 4096.

The rationale is that all code should use the same value; having
buffers specified with different sizes will lead to interoperability
and out of bounds array writes.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2018-05-18 12:17:07 -07:00 committed by Anas Nashif
commit 0f1d30aa67
3 changed files with 5 additions and 6 deletions

View file

@ -16,9 +16,6 @@ extern "C" {
#ifdef CONFIG_POSIX_FS
#include <fs.h>
#undef PATH_MAX
#define PATH_MAX 256
typedef struct fs_dir_t DIR;
typedef unsigned int mode_t;