]> dgit.raspbian.org Git - glibc.git/commit
Make F_RDLCK/F_WRLCK atomic
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 18 Oct 2016 21:10:46 +0000 (21:10 +0000)
committerAurelien Jarno <aurel32@debian.org>
Tue, 18 Oct 2016 21:10:46 +0000 (21:10 +0000)
commitd22ee389e6aeb845edf0a47a054d2a20bb0de2e6
tree55604a60a32f351465088da821bea48271fa75c1
parent071d4624026f682d46a9b9b79a2374ba3a1b244a
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