-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use F_OFD_SETLK instead of exfile_api() #5489
Labels
feature enhancement
category: a new feature (an extension of functionality)
Comments
alandekok
added
the
feature enhancement
category: a new feature (an extension of functionality)
label
Jan 7, 2025
The linux man page states:
|
The key bit being "held by another process". |
From the GNU page:
|
Would be very useful if they work :) |
https://www.austingroupbugs.net/view.php?id=768 - Potentially made it into FreeBSD in 2022? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Message
Linux and apparently OSX support F_OFD_SETLK, which is what you would really expect from F_SETLK.
https://lwn.net/Articles/586904/
https://www.gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html
https://man7.org/linux/man-pages/man2/fcntl.2.html
https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
It's not clear if FreeBSD has them.
This would let us get rid of most of exfile.c(), and replace it with just open / lock / close.
The issue with normal F_SETLK is that they are process specific. So two threads can't lock the same file. With F_OFD_SETLK, different threads should be able to lock the same file without an issue.
The text was updated successfully, but these errors were encountered: