Skip to content

Make fd_fgets thread safe #299

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

Merged

Conversation

radosroka
Copy link
Member

No description provided.

@radosroka radosroka changed the title Make fd_fgets thread safe [WIP] Make fd_fgets thread safe Apr 24, 2024
@radosroka
Copy link
Member Author

radosroka commented Apr 24, 2024

I think this can be optimized so there will be just one allocation per thread.

@stevegrubb
Copy link
Member

The patch seems to get rid of the race being detected with helgrind. But, in the fd_fgets.h file, the access attribute needs its numbers corrected to 2, 3 since the first arg is a pointer to the struct. Also, I'd suggest switching around init and destroy declaration order and then add __attr_dealloc(fd_fgets_destroy, 1) at the end of the init declaration.

@stevegrubb
Copy link
Member

LGTM

@radosroka radosroka merged commit 9a15d63 into linux-application-whitelisting:main Apr 29, 2024
26 of 30 checks passed
@radosroka radosroka changed the title [WIP] Make fd_fgets thread safe Make fd_fgets thread safe Apr 29, 2024
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