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(fd): implement fcntl(F_GETFL) #1626

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat(fd): implement fcntl(F_GETFL) #1626

wants to merge 3 commits into from

Conversation

mkroening
Copy link
Member

This implements fcntl(F_GETFL) in three steps:

  1. Move file status flags (O_APPEND and O_NONBLOCK) from OpenOptions into a new fd::StatusFlags type as per POSIX.
  2. Replace ObjectInterface::ioctl(&self, cmd: IoCtl, value: bool) with ObjectInterface::set_status_flags(&self, status_flags: fd::StatusFlags), as that seems more straightforward for adding methods compared to adding more values to IoCtl and handling those in the implementors.
  3. Implement fcntl(F_GETFL) by adding ObjectInterface::status_flags(&self).

This closes #1383.

@mkroening mkroening requested a review from stlankes March 4, 2025 18:18
@mkroening mkroening self-assigned this Mar 4, 2025
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.

Implement F_GETFL for fcntl
1 participant