Skip to content

Use F_OFD_SETLK instead of exfile_api() #5489

Open
@alandekok

Description

@alandekok

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature enhancementcategory: a new feature (an extension of functionality)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions