-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Wrapper/access for fcntl(fd, F_GETLK, …)
The fcntl module currently exposes the F_GETLK constant itself, but unfortunately because the types in struct flock are OS and CFLAGS dependent (off_t, pid_t), the operation is hard to work-around with struct.unpack.
Pitch
Exposing F_GETLK is particularly useful to determine if a process that created a lock file or pid file is actually still alive, vs. whether the lock/pid file was left uncleaned from a previous exit/crash/etc. The l_pid field is the most useful, but if wrapping the call anyway it might make more sense to just expose all values.
I've already implemented this, a PR is following shortly.
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement