Make F_RDLCK/F_WRLCK atomic
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 14 Jan 2018 10:24:48 +0000 (10:24 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sun, 14 Jan 2018 10:24:48 +0000 (10:24 +0000)
commitae5f69b613575a28ee9c3f112c79f78024b1f53e
treee2e1e18e4ed64ea366299fff3948a21266496984
parent1a9b4e5731e5c6022354ac422f1faa6259ba36db
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