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
Wrapper/access for
fcntl(fd, F_GETLK, …)The
fcntlmodule currently exposes theF_GETLKconstant itself, but unfortunately because the types instruct flockare OS and CFLAGS dependent (off_t,pid_t), the operation is hard to work-around withstruct.unpack.Pitch
Exposing
F_GETLKis 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. Thel_pidfield 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