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

Add a fallback for utimensat ENOSYS #20

Merged
merged 1 commit into from
Jan 17, 2018

Conversation

cuviper
Copy link
Contributor

@cuviper cuviper commented Jan 17, 2018

Even when libc has utimensat, the kernel may return ENOSYS,
and then we'll need to use the utimes fallback instead.

Even when libc has `utimensat`, the kernel may return `ENOSYS`,
and then we'll need to use the `utimes` fallback instead.
@alexcrichton
Copy link
Owner

I'm sort of curious, how does C manage this sort of issue? Does every library end up having similar patches along these lines?

In any case looks good, thanks! Would you like a version bump as well?

@alexcrichton alexcrichton merged commit 9ff5557 into alexcrichton:master Jan 17, 2018
@cuviper
Copy link
Contributor Author

cuviper commented Jan 17, 2018

The "fun" part is that the symlink lutimes fallback doesn't actually work. On newer systems, lutimes is implemented on top of utimensat anyway. On older systems like RHEL5, which have the lutimes symbol but no utimensat, it's just an ENOSYS stub. 🤷‍♂️

The fallback does work for set_file_times though.

@cuviper
Copy link
Contributor Author

cuviper commented Jan 17, 2018

how does C manage this sort of issue?

You can stick to old syscalls only, implement an ENOSYS fallback like this, or just raise your bar of supported kernels. You'll often see these kind of messes in autoconf'ed #if HAVE_FOO blocks.

A new release would be great, thanks!

@alexcrichton
Copy link
Owner

Hm ok, fascinating! I'm sort of glad I don't write C, I'd never remember all this...

In any case, 0.1.15 should be published now.

cuviper added a commit to cuviper/rust that referenced this pull request Jan 17, 2018
Fix for `ENOSYS` when calling `utimensat`, alexcrichton/filetime#20

r? @alexcrichton
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.

2 participants