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 support for utimensat as an alternative to lutimes (backport #11751) #11763

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Oct 28, 2024

OpenBSD doesn't support lutimes, but does support utimensat which subsumes it. In fact, all the BSDs, Linux, and newer macOS all support it. So lets make this our first choice for the implementation.

In addition, let's get rid of the lutimes ENOSYS special case. The Linux manpage says

ENOSYS

The kernel does not support this call; Linux 2.6.22 or later is
required.

which I think is the origin of this check, but that's a very old version of Linux at this point. The code can be simplified a lot of we drop support for it here (as we've done elsewhere, anyways).

Motivation

We've been working towards a more functional nix on various *BSD systems. This fixes a nonessential feature, and is useful i combination with #11750 which fixes build on OpenBSD

Context

OpenBSD does not support the lutimes syscall to mtime of a symlink. However, it supports the common utimensat syscall that allows setting mtimes with nanosecond precision for symlinks.

As part of the change, @Ericson2314 noticed that lutimes has been in Linux for 17 years and the fallback is no longer required, making it easier to clean up the code.

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.


This is an automatic backport of pull request #11751 done by [Mergify](https://mergify.com).

OpenBSD doesn't support `lutimes`, but does support `utimensat` which
subsumes it. In fact, all the BSDs, Linux, and newer macOS all support
it. So lets make this our first choice for the implementation.

In addition, let's get rid of the `lutimes` `ENOSYS` special case. The
Linux manpage says

> ENOSYS
>
> The kernel does not support this call; Linux 2.6.22 or later is
> required.

which I think is the origin of this check, but that's a very old version
of Linux at this point. The code can be simplified a lot of we drop
support for it here (as we've done elsewhere, anyways).

Co-Authored-By: John Ericson <[email protected]>
(cherry picked from commit d023202)
@mergify mergify bot requested a review from edolstra as a code owner October 28, 2024 10:27
@mergify mergify bot added the merge-queue label Oct 28, 2024
@Ericson2314 Ericson2314 merged commit baa7565 into 2.24-maintenance Oct 28, 2024
24 of 26 checks passed
@Ericson2314 Ericson2314 deleted the mergify/bp/2.24-maintenance/pr-11751 branch October 28, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants