Skip to content
Permalink
Browse files

posix: unistd.h: open() doesn't belong here

Per POSIX, open() is defined in <fcntl.h>. fcntl.h in turn comes from
the underlying libc, either newlib, or minimal libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  • Loading branch information...
pfalcon authored and galak committed Jun 4, 2019
1 parent 1347bf9 commit b7bb48eeac579b871937e8387af708121b97e6bd
@@ -21,7 +21,6 @@ extern "C" {
#include <fs/fs.h>

/* 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);
@@ -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_ */
@@ -7,6 +7,7 @@
#include <ztest.h>
#include <zephyr.h>
#include <sys/printk.h>
#include <fcntl.h>
#include <mqueue.h>
#include <pthread.h>

@@ -5,6 +5,7 @@
*/

#include <stdio.h>
#include <fcntl.h>
#include <posix/unistd.h>
#include <posix/dirent.h>
#include "test_fs.h"
@@ -5,6 +5,7 @@
*/

#include <string.h>
#include <fcntl.h>
#include <posix/unistd.h>
#include "test_fs.h"

0 comments on commit b7bb48e

Please sign in to comment.
You can’t perform that action at this time.