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:
parent
5e87c08a39
commit
0f1d30aa67
3 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ extern "C" {
|
|||
#define ULONG_MAX 0xFFFFFFFFul
|
||||
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFull
|
||||
|
||||
#define PATH_MAX 256
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <kernel.h>
|
||||
#include <limits.h>
|
||||
#include <posix/pthread.h>
|
||||
#include <posix/unistd.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
union file_desc {
|
||||
struct fs_file_t file;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue