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

std: add optional times pointer for futimes, futimens, utimes, utimensat #22248

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

thejohnny5
Copy link
Contributor

@thejohnny5 thejohnny5 commented Dec 15, 2024

Fixes #22194

For optional pointer with WASI, passes 0 for atim and mtim and sets flags for ATIM_NOW and MTIM_NOW to true in futimens.

@alexrp
Copy link
Member

alexrp commented Jan 29, 2025

@squeek502 would you mind taking a look at the WASI stuff?

@alexrp alexrp requested a review from squeek502 January 29, 2025 07:55
Copy link
Collaborator

@squeek502 squeek502 left a comment

Choose a reason for hiding this comment

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

Additional WASI logic in posix.futimens seems good; it matches the corresponding logic in wasi-libc:

https://github.com/ziglang/zig/blob/master/lib/libc/wasi/libc-bottom-half/cloudlibc/src/libc/sys/stat/stat_impl.h#L75-L80

(note that we are still not handling UTIME_OMIT/UTIME_NOW, but that's already covered by the existing TODO)

@alexrp alexrp merged commit 78b7a44 into ziglang:master Jan 29, 2025
10 checks passed
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.

std.posix.futimens() and related functions should take an optional pointer for "times"
3 participants