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

no fdatasync prototype on OS X #285

Closed
yallop opened this issue Oct 28, 2016 · 3 comments
Closed

no fdatasync prototype on OS X #285

yallop opened this issue Oct 28, 2016 · 3 comments

Comments

@yallop
Copy link
Contributor

yallop commented Oct 28, 2016

fdatasync is apparently available as a system call in OS X, but there's no prototype for it in unistd.h.

The configure test (which only checks that a program using fdatasync can be linked) succeeds, but compiling the source reveals the problem:

src/unix/jobs-unix/lwt_unix_job_fdatasync.c:61:17: warning: implicit declaration of function 'fdatasync' is invalid in C99 [-Wimplicit-function-declaration]
  job->result = fdatasync(job->fd);
                ^
1 warning generated.
@aantron
Copy link
Collaborator

aantron commented Oct 28, 2016

I found this some days ago as well: d3f7e66.

I haven't tested if fdatasync actually works on OS X, and obviously using an undocumented system call is not the best style. However, it doesn't seem to have caused any actual problems yet. Do you think it should be removed?

@yallop
Copy link
Contributor Author

yallop commented Oct 28, 2016

If the fdatasync prototype were intended to be used on OS X then it'd be worth adding a prototype. But I think the fact that there's no prototype in the first place indicates that it's not intended to be used. So the best thing is to check during configuration whether it's exposed. I'll open a PR to do that.

aantron added a commit that referenced this issue Oct 28, 2016
Consequence of preceding commit. See #285.
@aantron
Copy link
Collaborator

aantron commented Oct 28, 2016

Thank you.

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

No branches or pull requests

2 participants