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(fdtable): add CLOEXEC flag #162

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Stone749990226
Copy link

Add support for the CLOEXEC flag in file descriptors.

@Stone749990226 Stone749990226 force-pushed the dev branch 3 times, most recently from 2db9013 to 5ead86a Compare January 16, 2025 17:28
@ken4647 ken4647 self-requested a review January 20, 2025 04:42
modules/ruxtask/src/fs.rs Outdated Show resolved Hide resolved
modules/ruxtask/src/fs.rs Outdated Show resolved Hide resolved
chore: apply code style fixes and update documentation
@@ -61,19 +62,20 @@ pub fn get_file_like(fd: i32) -> LinuxResult<Arc<dyn FileLike>> {
}

/// Adds a file like object to the file descriptor table and returns the file descriptor.
pub fn add_file_like(f: Arc<dyn FileLike>) -> LinuxResult<i32> {
pub fn add_file_like(f: Arc<dyn FileLike>, flags: usize) -> LinuxResult<i32> {
Copy link
Contributor

Choose a reason for hiding this comment

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

it is better to use a enum type instead of usize for this flags, as it is a interface for kernel inside. Using a enum type make it more meaningful.

Copy link
Contributor

Choose a reason for hiding this comment

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

there is a data structre named OpenOption in modules/ruxfs/src/fops.rs , I think it may be more suitable.

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.

2 participants