-
Notifications
You must be signed in to change notification settings - Fork 61
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
chapters/io: Fix wwrite and rread logic from my-cat #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To pass checkpatch [1] you'll have to reword your commits in a way similar to the previous ones in the repo [2]:
- chapters/io: Fix `rread()` and `wwrite()` logic
- chapters/io: Fix typo in `mmap_cp` task
Always use imperative verbs when making commits and prefix them with the component that you're changing. In addition, add a signed-off-by line to your commits and a short description of each of them. All these requirements are described here [3].
To reword your commits you'll have to run git rebase -i 30b256fd6e4dc20029a2e6503d938de9c7ed0564
(The latter ID is the sha of the last commit before yours; That's why it's easier to create a pull request from a different branch than main
so that you can use git rebase -i main
instead of a commit ID). This command will open your default editor with a 2-line list of your 2 commits. There you will change the first word of each line from "pick" to "r" (from "reword"), then save and exit. Then the editor will switch to the first and second commit messages that you can modify as I said above. After doing all this, use git push -f
to push your changes to the remote repo.
[1] https://github.com/cs-pub-ro/operating-systems/actions/runs/12144710669/job/33893529314?pr=146#step:3:572
[2] https://github.com/cs-pub-ro/operating-systems/commits/main/
[3] https://github.com/cs-pub-ro/operating-systems/blob/main/CONTRIBUTING.md#commits
As per `read()` and `write()` syscall wrappers documentation, the return value of a successful operation is the count of bytes read/written that could be less than the length given as param. Signed-off-by: Andrei Adrian Ragman <[email protected]>
Correct the name of wrapper from `ftstat()` to `fstat()`. Signed-off-by: Andrei Adrian Ragman <[email protected]>
Prerequisite Checklist
Description of changes
As per the
read
andwrite
syscall wrappers, the functions return the number of bytes that have been successfully read or written. The buffer offset should be updated accordingly, as implemented.