Skip to content

Conversation

@iburaky2
Copy link
Contributor

@iburaky2 iburaky2 commented Jan 5, 2026

#9870 coincidentally works on linux but does not work on platforms where UTIME_NOW which is originally a long doesn't fit into u32, such as freebsd.

It's not possible to use UTIME_NOW in utimensat with the filetimes crate on these platforms. I copied the relevant piece of code being called from filetimes so I can call libc::utimensat directly. Providing a nullptr as the times argument as the same effect as both tv_nsec fields being UTIME_NOW.

For the tests, OpenBSD doesn't have a /dev/full but touch /dev/null essentially tests the same permission issue.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 5, 2026

CodSpeed Performance Report

Merging #10063 will improve performance by 3.57%

Comparing iburaky2:fix-touch-dev-full (22b3425) with main (666c6df)

Summary

⚡ 1 improvement
✅ 138 untouched
⏩ 37 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Efficiency
tsort_input_parsing_heavy[5000] 73 ms 70.5 ms +3.57%

Footnotes

  1. 37 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

set_file_times(path, atime, mtime)
#[cfg(unix)]
{
if opts.source == Source::Now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment explaining why you are doing this


#[test]
#[cfg(target_os = "linux")]
#[cfg(all(unix, not(target_os = "openbsd")))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not openbsd ?

Copy link
Contributor Author

@iburaky2 iburaky2 Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openbsd doesn't have /dev/full
https://man.openbsd.org/MAKEDEV.8

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