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

feat(os): add posix message queue syscalls #1363

Merged
merged 4 commits into from Jul 4, 2023

Conversation

chinggg
Copy link
Contributor

@chinggg chinggg commented Jun 28, 2023

To solve #1346, I implement msgget, msgsnd, msgrcv syscalls to fulfill the IPC syscall. To support message queue for QlOsPosix, I add QlMsq, a component similar to existing QlShm.

If we want to support semaphore in the future, the code can be refactored to share code for different IPC objects, just as https://elixir.bootlin.com/linux/v5.19.17/source/ipc/util.c did.

Re-implementing syscalls is error-prone, and it is impossible to be exactly same as the original implementation. Simple examples or unit tests can be added to ensure the basic functionality.

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


posix: add QlMsq to QlOsPosix
syscalls: implement msgget, msgsnd, msgrcv
elicn added 2 commits July 3, 2023 15:23
Mostly styling fixes.
Fix handling of a few corner cases.
Styling fixes.
Copy link
Member

@elicn elicn left a comment

Choose a reason for hiding this comment

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

@chinggg, I committed a few changes to your code.
Please let me know if you're OK with the changes.

Overlooked indent error
@chinggg
Copy link
Contributor Author

chinggg commented Jul 3, 2023

Thanks for reviewing and refining the code. LGTM!

@elicn elicn requested review from xwings and kabeor July 3, 2023 16:36
@xwings xwings merged commit 83bcbbf into qilingframework:dev Jul 4, 2023
5 checks passed
@xwings
Copy link
Member

xwings commented Jul 4, 2023

Hey,

thanks!

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.

None yet

3 participants