Skip to content

timestamp modification system call support#1611

Draft
libumem wants to merge 12 commits intoqilingframework:devfrom
libumem:dev
Draft

timestamp modification system call support#1611
libumem wants to merge 12 commits intoqilingframework:devfrom
libumem:dev

Conversation

@libumem
Copy link
Copy Markdown
Contributor

@libumem libumem commented Apr 19, 2026

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


This PR adds support for the syscalls:

  • utime
  • futimesat
  • utimes
  • utimensat

and adds source code for an example to be merged in the rootfs repo.

@libumem libumem marked this pull request as draft April 19, 2026 02:19
@libumem
Copy link
Copy Markdown
Contributor Author

libumem commented Apr 19, 2026

Converting to draft until qilingframework/rootfs#37 is handled

@xwings
Copy link
Copy Markdown
Member

xwings commented Apr 27, 2026

Two issues need fixes before merge:

  1. times is nullable for utime(2), utimes(2), and utimensat(2). Linux treats a NULL pointer as "set atime/mtime to now" subject to the normal permission rules. This implementation currently either dereferences 0 in do_utime() or returns positive EACCES from ql_syscall_utimensat(), which is not a syscall error under Qiling return conventions. Please handle times == 0 by setting both timestamps to now and return negative errno values on failure.

  2. futimesat(2) takes struct timeval times[2], while utimensat(2) takes struct timespec times[2]. The current ql_syscall_futimesat() delegates to the utimensat path, so the second field is parsed as nanoseconds instead of microseconds. Please use a timeval-aware path like utimes() and multiply tv_usec by 1000 before calling os.utime(ns=...).

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