Skip to content

stdio: implement flockfile, ftrylockfile, funlockfile#477

Open
julianuziemblo wants to merge 2 commits into
masterfrom
julianuziemblo/RTOS-1334
Open

stdio: implement flockfile, ftrylockfile, funlockfile#477
julianuziemblo wants to merge 2 commits into
masterfrom
julianuziemblo/RTOS-1334

Conversation

@julianuziemblo
Copy link
Copy Markdown
Contributor

@julianuziemblo julianuziemblo commented May 22, 2026

YT: RTOS-1334

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements recursive locking for stdio streams by introducing the ftrylockfile function and updating flockfile and funlockfile to utilize mutex operations. It also updates fopen, fdopen, popen, and internal file initialization to use mutexCreateWithAttr with a recursive lock attribute. The review feedback correctly identifies that the return values of mutexCreateWithAttr in fopen and fdopen are not checked, which could lead to undefined behavior if a lock fails to initialize. Suggestions were provided to include proper error handling and resource cleanup in these functions.

Comment thread stdio/file.c Outdated
Comment thread stdio/file.c
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch from 0531361 to e3f29f7 Compare May 22, 2026 11:44
@github-actions
Copy link
Copy Markdown

Unit Test Results

10 618 tests   9 948 ✅  52m 0s ⏱️
   649 suites    670 💤
     1 files        0 ❌

Results for commit e3f29f7.

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.

1 participant