Skip to content

fcntl(SETLKW) fails on standard streams #102

@dmik

Description

@dmik

LIBCx replaces the LIBC implementation of fcntl(SETLKW) and friends which uses DosSetFileLocks because the latter does not guarantee atomicity of lock/unlock operations in many cases (like overlapping lock regions etc.) and does not have deadlock detection. However, the current LIBCx implementation only supports regular files (i.e. files which have a valid path that is used as a key). Neither standard I/O streams nor pipes nor sockets are not supported (and fcntl(SETLKW) will return EINVAL on them) .

It is possible to make up unique keys for stdio streams and pipes (and even sockets) and make them work too but it requires some coding and testing. One case where we found it failing is this: bitwiseworks/kbuild-os2#5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions