This is the mail archive of the
mailing list for the glibc project.
Re: pthread cancellation points missing for fdatasync and lockf in some cases
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Mike Frysinger" <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 5 May 2007 12:25:34 -0400
- Subject: Re: pthread cancellation points missing for fdatasync and lockf in some cases
- References: <firstname.lastname@example.org>
On 5/5/07, Mike Frysinger <email@example.com> wrote:
POSIX requires fdatasync() and lockf() be pthread cancellation endpoints but
it looks like they get missed a little in glibc ...
Is there a reference for this?
fdatasync() is generated for Linux simply via syscalls.list as a pass through
to the kernel... the generic case in misc/fdatasync.c relies on fsync() being
a cancellation endpoint ... so here, just Linux is broken it seems
A patch for this would be to add "C" to the fdatasync signature in
as for lockf(), this seems to be [incorrectly] done on purpose ... io/lockf.c
talks about relying on fcntl()'s cancellation endpoint when called with
F_SETLKW as that is the only case that POSIX says fcntl() should be a
cancellation endpoint ... however, POSIX does not grant this limitation to
lockf() ... it should always be a cancellation endpoint regardless of the
arguments it is called with
Use LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET to fix this.
Then write a test to prove it works? :-)
Care to file this in the bugzilla so we don't forget.