Make F_RDLCK/F_WRLCK atomic
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 4 Dec 2016 21:49:53 +0000 (21:49 +0000)
committerSamuel Thibault <sthibault@debian.org>
Sun, 4 Dec 2016 21:49:53 +0000 (21:49 +0000)
commitf0c27975f9f9891dc35065237816f7b974402296
treed8d3e559984e36b8b2950903cb02ed5152ea50b4
parent4bb38a72a0a58b1eb5034921fb5321ac3c070b59
Make F_RDLCK/F_WRLCK atomic

lockf(LOCK_EX) would for instance drop any existing shared lock before taking
the exclusive lock. F_RDLCK/F_WRLCK need atomic changes, so introduce and use
__LOCK_ATOM

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* misc/sys/file.h (__LOCK_ATOMIC): New macro.
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Use __LOCK_ATOMIC along LOCK_SH and
LOCK_EX.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name tg-WRLCK-upgrade.diff
misc/sys/file.h
sysdeps/mach/hurd/fcntl.c