Skip to content

Updates to creat_syscall()#287

Merged
rennergade merged 5 commits intodevelopfrom
naman_creat
Jul 2, 2024
Merged

Updates to creat_syscall()#287
rennergade merged 5 commits intodevelopfrom
naman_creat

Conversation

@namanlalitnyu
Copy link
Copy Markdown
Contributor

Description

Fixes # (issue)
The following changes include the tests and comments in the code for the "creat_syscall" file system call under RustPosix.
The tests were added to cover all the possible scenarios that might happen when calling the file system_call creat_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 creat_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_creat_new_file()
  • Test B - ut_lind_fs_creat_truncate_existing_file()

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 changed the title Updated to creat_syscall() Updates to creat_syscall() Jun 30, 2024
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/tests/fs_tests.rs
@namanlalitnyu namanlalitnyu requested review from Anway-Agte and rupeshkoushik07 and removed request for rupeshkoushik07 June 30, 2024 21:14
@namanlalitnyu
Copy link
Copy Markdown
Contributor Author

@Anway-Agte @rupeshkoushik07 , please can you review these changes.

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

@rupeshkoushik07 rupeshkoushik07 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 namanlalitnyu requested a review from rennergade July 2, 2024 12:30
@namanlalitnyu
Copy link
Copy Markdown
Contributor Author

@rennergade pls can you review this PR?

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.

You need to fix a merge conflict but otherwise approved. Good job!

@namanlalitnyu
Copy link
Copy Markdown
Contributor Author

You need to fix a merge conflict but otherwise approved. Good job!

Thanks Nick, I have resolved the merge conflicts. Can you please check once.

@rennergade rennergade merged commit 1504129 into develop Jul 2, 2024
/// * ENXIO - the file is of type UNIX domain socket
///
/// A panic occurs when there is some issue fetching the file descriptor.
/// ### Panics
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you explain a bit more about the EINVAL and ENXIO errors?

@@ -4488,8 +4550,8 @@ impl Cage {
drop(sementry);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this sementry variable indicate?

Comment thread src/tests/fs_tests.rs
let fd = cage.creat_syscall(path, S_IRWXA);
assert!(fd > 0);

let mut statdata = StatData::default();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the StatData object?

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.

4 participants