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

fix windows compile error for directio pkg #275

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Jan 3, 2023

Signed-off-by: YangKeao yangkeao@chunibyo.icu

The directio pkg uses unix.EINVAL, which doesn't exit in windows. To support windows, I'd add a compilation flag and use the original directio directly.

I also find that the errors returned in the darwin and openbsd is different with Linux. In Linux, it returns the return the EINVAL (directly by the system call). For darwin, it's a software defined "Failed to set F_NOCACHE: %s". The windows seems to be more complicated. As I don't have a Mac OS / Windows device, I left it here to return the result directly.

Actually, I'm not sure whether there are file systems like tmpfs which don't support direct io in Mac OS and other systems.

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@coocood coocood merged commit 828f39b into pingcap:master Jan 3, 2023
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 this pull request may close these issues.

3 participants