File tree 4 files changed +39
-11
lines changed
4 files changed +39
-11
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2018 Intel Corporation
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ #ifndef ZEPHYR_INCLUDE_POSIX_DIRENT_H_
7
+ #define ZEPHYR_INCLUDE_POSIX_DIRENT_H_
8
+
9
+ #ifdef __cplusplus
10
+ extern "C" {
11
+ #endif
12
+
13
+ #include <limits.h>
14
+ #include "sys/types.h"
15
+
16
+ #ifdef CONFIG_POSIX_FS
17
+ #include <fs.h>
18
+
19
+ typedef struct fs_dir_t DIR ;
20
+
21
+ struct dirent {
22
+ unsigned int d_ino ;
23
+ char d_name [PATH_MAX + 1 ];
24
+ };
25
+
26
+ /* Directory related operations */
27
+ extern DIR * opendir (const char * dirname );
28
+ extern int closedir (DIR * dirp );
29
+ extern struct dirent * readdir (DIR * dirp );
30
+
31
+ #endif
32
+
33
+ #ifdef __cplusplus
34
+ }
35
+ #endif
36
+
37
+ #endif /* ZEPHYR_INCLUDE_POSIX_DIRENT_H_ */
Original file line number Diff line number Diff line change @@ -16,26 +16,15 @@ extern "C" {
16
16
#ifdef CONFIG_POSIX_FS
17
17
#include <fs.h>
18
18
19
- typedef struct fs_dir_t DIR ;
20
19
typedef unsigned int mode_t ;
21
20
22
- struct dirent {
23
- unsigned int d_ino ;
24
- char d_name [PATH_MAX + 1 ];
25
- };
26
-
27
21
/* File related operations */
28
22
extern int open (const char * name , int flags );
29
23
extern int close (int file );
30
24
extern ssize_t write (int file , char * buffer , unsigned int count );
31
25
extern ssize_t read (int file , char * buffer , unsigned int count );
32
26
extern int lseek (int file , int offset , int whence );
33
27
34
- /* Directory related operations */
35
- extern DIR * opendir (const char * dirname );
36
- extern int closedir (DIR * dirp );
37
- extern struct dirent * readdir (DIR * dirp );
38
-
39
28
/* File System related operations */
40
29
extern int rename (const char * old , const char * newp );
41
30
extern int unlink (const char * path );
Original file line number Diff line number Diff line change 9
9
#include <limits.h>
10
10
#include <posix/pthread.h>
11
11
#include <posix/unistd.h>
12
+ #include <posix/dirent.h>
12
13
#include <string.h>
13
14
14
15
BUILD_ASSERT_MSG (PATH_MAX > MAX_FILE_NAME ,
Original file line number Diff line number Diff line change 6
6
7
7
#include <stdio.h>
8
8
#include <posix/unistd.h>
9
+ #include <posix/dirent.h>
9
10
#include "test_fs.h"
10
11
11
12
extern int test_file_write (void );
You can’t perform that action at this time.
0 commit comments