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

chapters/io: Fix wwrite and rread logic from my-cat #146

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

andrei811
Copy link

@andrei811 andrei811 commented Dec 3, 2024

Prerequisite Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Updated relevant documentation (if needed).

Description of changes

As per the read and write 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.

@andrei811 andrei811 changed the title Fixed writing and reading logic from chapters/io chapters/io Fixed writing and reading logic from my-cat Dec 3, 2024
@andrei811 andrei811 changed the title chapters/io Fixed writing and reading logic from my-cat chapters/io Fixed wwrite and rread logic from my-cat Dec 3, 2024
@andrei811 andrei811 changed the title chapters/io Fixed wwrite and rread logic from my-cat chapters/io: Fixed wwrite and rread logic from my-cat Dec 3, 2024
@andrei811 andrei811 changed the title chapters/io: Fixed wwrite and rread logic from my-cat chapters/io: Fix wwrite and rread logic from my-cat Dec 3, 2024
@github-actions github-actions bot added area/tasks Update to tasks topic/io Related to "Input/Output" chapter labels Dec 4, 2024
Copy link

@teodutu teodutu left a comment

Choose a reason for hiding this comment

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

Thanks!

@teodutu teodutu added student-contrib Fix or improvement made by a student kind/fix Fix issues with existing content / item labels Dec 4, 2024
Copy link

@teodutu teodutu left a 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]>
@teodutu teodutu merged commit b7a2314 into cs-pub-ro:main Dec 12, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tasks Update to tasks kind/fix Fix issues with existing content / item student-contrib Fix or improvement made by a student topic/io Related to "Input/Output" chapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants