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

lib/vfscore: Correct behavior of utime(NULL) #993

Closed
wants to merge 1 commit into from

Conversation

andreittr
Copy link
Contributor

Description of changes

Previously, as a placeholder behavior, utime(NULL) would set the file times to the epoch (1970-01-01 00:00 -0000) instead of the current time. This change corrects this oversight, bringing the syscall in line with expected and documented behavior.

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): N/A
  • Platform(s): N/A
  • Application(s): N/A

Additional configuration

Test with:

utime("file", NULL);
stat("file", &st);
printf("%ld %ld\n", st.st_atime, st.st_mtime);

@andreittr andreittr requested a review from a team as a code owner July 24, 2023 21:08
@razvand razvand requested review from Starnox, fabianpatras and calex257 and removed request for a team July 24, 2023 21:55
@razvand razvand self-assigned this Jul 24, 2023
@razvand razvand added area/lib Internal Unikraft Microlibrary kind/quick-fix Issue is a quick fix lib/vfscore VFS Core Interface lang/c Issues or PRs to do with C/C++ priority/medium labels Jul 24, 2023
@razvand razvand added this to the v0.14.0 (Prometheus) milestone Jul 24, 2023
Copy link
Contributor

@Starnox Starnox left a comment

Choose a reason for hiding this comment

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

Works as expected

Reviewed-by: Eduard-Florin Mihailescu mihailescu.eduard@gmail.com

Copy link
Member

@eduardvintila eduardvintila left a comment

Choose a reason for hiding this comment

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

All good on my side.

Reviewed-by: Eduard Vintilă eduard.vintila47@gmail.com

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

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

Approved-by: Razvan Deaconescu razvand@unikraft.io

Previously, as a placeholder behavior, utime(NULL) would set the file
times to the epoch (1970-01-01 00:00 -0000) instead of the current time.
This change corrects this oversight, bringing the syscall in line with
expected and documented behavior.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
@unikraft-bot unikraft-bot added the ci/merged Merged by CI label Aug 7, 2023
@andreittr andreittr deleted the ttr/utime-null branch August 7, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary ci/merged Merged by CI kind/quick-fix Issue is a quick fix lang/c Issues or PRs to do with C/C++ lib/vfscore VFS Core Interface priority/medium
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

5 participants