Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding IFTODT for more compatibility #268

Closed
kateinoigakukun opened this issue Mar 2, 2022 · 1 comment · Fixed by #279
Closed

Adding IFTODT for more compatibility #268

kateinoigakukun opened this issue Mar 2, 2022 · 1 comment · Fixed by #279

Comments

@kateinoigakukun
Copy link
Contributor

Currently IFTODT is not defined in wasi-libc, even though DT_XXX family are defined.

#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
#define DT_UNKNOWN 0
#define DT_FIFO 1
#define DT_CHR 2
#define DT_DIR 4
#define DT_BLK 6
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
#define DT_WHT 14
#define IFTODT(x) ((x)>>12 & 017)
#define DTTOIF(x) ((x)<<12)
#endif
int getdents(int, struct dirent *, size_t);
#endif

On the ruby side, we faced a compatibility issue due to missing IFTODT ruby/ruby#5614 because we assume IFTODT is always defined when DT_UNKNOWN is defined, and other platforms are compatible with this.

Do you think it would be worth adding IFTODT?

@sunfishcode
Copy link
Member

Yes, it looks like we should add a IFTODT.

sunfishcode added a commit that referenced this issue Mar 24, 2022
sunfishcode added a commit that referenced this issue Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants