From b7bb48eeac579b871937e8387af708121b97e6bd Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 4 Jun 2019 23:14:22 +0300 Subject: [PATCH] posix: unistd.h: open() doesn't belong here Per POSIX, open() is defined in . fcntl.h in turn comes from the underlying libc, either newlib, or minimal libc. Signed-off-by: Paul Sokolovsky --- include/posix/unistd.h | 1 - lib/libc/minimal/include/fcntl.h | 2 ++ tests/posix/common/src/mqueue.c | 1 + tests/posix/fs/src/test_fs_dir.c | 1 + tests/posix/fs/src/test_fs_file.c | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/posix/unistd.h b/include/posix/unistd.h index d25006a557d..fb1fe806b5c 100644 --- a/include/posix/unistd.h +++ b/include/posix/unistd.h @@ -21,7 +21,6 @@ extern "C" { #include /* File related operations */ -extern int open(const char *name, int flags); extern int close(int file); extern ssize_t write(int file, const void *buffer, size_t count); extern ssize_t read(int file, void *buffer, size_t count); diff --git a/lib/libc/minimal/include/fcntl.h b/lib/libc/minimal/include/fcntl.h index 23028f35239..caa79c91965 100644 --- a/lib/libc/minimal/include/fcntl.h +++ b/lib/libc/minimal/include/fcntl.h @@ -15,4 +15,6 @@ #define F_GETFL 3 #define F_SETFL 4 +int open(const char *name, int flags); + #endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_FCNTL_H_ */ diff --git a/tests/posix/common/src/mqueue.c b/tests/posix/common/src/mqueue.c index d7123ea64e6..c83f3751fbc 100644 --- a/tests/posix/common/src/mqueue.c +++ b/tests/posix/common/src/mqueue.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/tests/posix/fs/src/test_fs_dir.c b/tests/posix/fs/src/test_fs_dir.c index 46e4f0311f3..4b3d02ebe7c 100644 --- a/tests/posix/fs/src/test_fs_dir.c +++ b/tests/posix/fs/src/test_fs_dir.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include "test_fs.h" diff --git a/tests/posix/fs/src/test_fs_file.c b/tests/posix/fs/src/test_fs_file.c index 5b6036a2cc6..614f99ac47d 100644 --- a/tests/posix/fs/src/test_fs_file.c +++ b/tests/posix/fs/src/test_fs_file.c @@ -5,6 +5,7 @@ */ #include +#include #include #include "test_fs.h"