Skip to content

Updates to "read_syscall" and "pread_syscall".#293

Merged
rennergade merged 9 commits intodevelopfrom
naman_read
Jul 11, 2024
Merged

Updates to "read_syscall" and "pread_syscall".#293
rennergade merged 9 commits intodevelopfrom
naman_read

Conversation

@namanlalitnyu
Copy link
Copy Markdown
Contributor

Description

Fixes # (issue)
The following changes include the tests and comments in the code for the "read_syscall" and "pread_syscall" file system calls under RustPosix.
The tests were added to cover all the possible scenarios that might happen when calling the file system_calls read_syscall and pread_syscall.

Type of change

  • This change just contains the tests for an existing file system call.
  • This change contains the minor code changes and comments for read_syscall and pread_syscall.
  • This change contains code reformatting for existing file system calls.

How Has This Been Tested?

Inorder to run the tests, we need to run cargo test --lib command inside the safeposix-rust directory.

All the tests are present under this directory: lind_project/src/safeposix-rust/src/tests/fs_tests.rs

  • Test A - ut_lind_fs_read_write_only_fd()
  • Test B - ut_lind_fs_read_from_directory()
  • Test C - ut_lind_fs_read_from_epoll()
  • Test D - ut_lind_fs_read_from_regular_file()
  • Test E - ut_lind_fs_read_from_chardev_file()
  • Test F - ut_lind_fs_read_from_sockets()
  • Test G - ut_lind_fs_read_from_pipe_blocking_mode()
  • Test H - ut_lind_fs_read_from_pipe_nonblocking_mode()
  • Test I - ut_lind_fs_pread_write_only_fd()
  • Test J - ut_lind_fs_pread_from_file()
  • Test K - ut_lind_fs_pread_from_directory()
  • Test L - ut_lind_fs_pread_invalid_types()

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@namanlalitnyu namanlalitnyu requested a review from ve1nard July 8, 2024 22:37
@namanlalitnyu
Copy link
Copy Markdown
Contributor Author

namanlalitnyu commented Jul 8, 2024

@ve1nard and @Anway-Agte, requesting your review of these changes.
Thanks!

Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
@namanlalitnyu namanlalitnyu requested a review from Anway-Agte July 9, 2024 15:45
Copy link
Copy Markdown
Contributor

@ve1nard ve1nard left a comment

Choose a reason for hiding this comment

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

lgtm!

@namanlalitnyu
Copy link
Copy Markdown
Contributor Author

@yashaswi2000, Please can you review these changes.
Thanks!

Copy link
Copy Markdown
Contributor

@yashaswi2000 yashaswi2000 left a comment

Choose a reason for hiding this comment

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

looks almost done. great job with the tests!

Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Copy link
Copy Markdown
Contributor

@yashaswi2000 yashaswi2000 left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread src/interface/misc.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Copy link
Copy Markdown
Contributor

@rennergade rennergade left a comment

Choose a reason for hiding this comment

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

Some minor changes requested. Looks good!

@namanlalitnyu namanlalitnyu requested a review from rennergade July 11, 2024 21:31
Copy link
Copy Markdown
Contributor

@rennergade rennergade left a comment

Choose a reason for hiding this comment

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

Approved.

@rennergade rennergade merged commit 01105d9 into develop Jul 11, 2024
Anway-Agte pushed a commit that referenced this pull request Jul 12, 2024
* Added comments for read, pread, _read_chr_file functions

* Merge conflicts resolved

* Added tests for read_syscall

* Added tests for pread_syscall

* reverted formatting changes for different file

* Addressed review comments

* Addressed review comments

* Addressed review comments and added comments for a potential bug

* Addressed review comments

---------

Co-authored-by: lind <lind@nyu.edu>
Anway-Agte pushed a commit that referenced this pull request Jul 15, 2024
* Added comments for read, pread, _read_chr_file functions

* Merge conflicts resolved

* Added tests for read_syscall

* Added tests for pread_syscall

* reverted formatting changes for different file

* Addressed review comments

* Addressed review comments

* Addressed review comments and added comments for a potential bug

* Addressed review comments

---------

Co-authored-by: lind <lind@nyu.edu>
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.

5 participants