File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <__header_dirent.h>
2
+ #include <__mode_t.h>
3
+
4
+ int __wasilibc_iftodt (int x ) {
5
+ switch (x ) {
6
+ case S_IFDIR : return DT_DIR ;
7
+ case S_IFCHR : return DT_CHR ;
8
+ case S_IFBLK : return DT_BLK ;
9
+ case S_IFREG : return DT_REG ;
10
+ case S_IFIFO : return DT_FIFO ;
11
+ case S_IFLNK : return DT_LNK ;
12
+ #ifdef DT_SOCK
13
+ case S_IFSCK : return DT_SOCK ;
14
+ #endif
15
+ case default : return DT_UNKNOWN ;
16
+ }
17
+ }
18
+
19
+ int __wasilibc_dttoif (int x ) {
20
+ switch (x ) {
21
+ case DT_DIR : return S_IFDIR ;
22
+ case DT_CHR : return S_IFCHR ;
23
+ case DT_BLK : return S_IFBLK ;
24
+ case DT_REG : return S_IFREG ;
25
+ case DT_FIFO : return S_IFIFO ;
26
+ case DT_LNK : return S_IFLNK ;
27
+ #ifdef DT_SOCK
28
+ case DT_SOCK : return S_IFSCK ;
29
+ #endif
30
+ case DT_UNKNOWN : return S_IFSCK ;
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments