-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Advisory lock on an open file using flock not working #11797
Comments
The python locking implemented in tools/filelock.py is part of the compiler driver and nothing to do with the runtime. It looks like Line 112 in c5cc009
|
@sbc100 thank you for the information. Are you saying that POSIX record locks (fcntl) is implemented and should work? |
I looks from the test you linked to at hat least the F_GETLK and F_SETLK fcntls return errno 0. It looks like they mostly stubbed out: emscripten/src/library_syscall.js Line 1160 in 126fa66
Remember that emscripten is not multi-process and the filesystem is basically local the running module, so the actually locking functionality I don't think make much sense. What you are hoping to lock against in your application exactly? |
@sbc100 thank you for the information. We will need to discuss the locking and whether or not it makes sense as you have mentioned. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Using flock does not seem to work.
The API is implemented and it's used by some of emscripten internal tooling (https://github.com/emscripten-core/emscripten/blob/master/tools/filelock.py#L363).
In the tests there are tests for fnctl that reference struct flock: https://github.com/emscripten-core/emscripten/blob/master/tests/fcntl/test_fcntl.c#L57
But there do not seem to be any tests that use flock.
The text was updated successfully, but these errors were encountered: