From 09b81d30ae629d75d03972b872eab71e24605bb6 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 29 Aug 2016 05:37:03 +0000 Subject: MFC r304209: The fdatasync(2) call must be cancellation point. --- lib/libthr/thread/thr_syscalls.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/libthr/thread/thr_syscalls.c') diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c index 712249b..362826c 100644 --- a/lib/libthr/thread/thr_syscalls.c +++ b/lib/libthr/thread/thr_syscalls.c @@ -227,6 +227,20 @@ __thr_fsync(int fd) return (ret); } +static int +__thr_fdatasync(int fd) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter2(curthread, 0); + ret = __sys_fdatasync(fd); + _thr_cancel_leave(curthread, 1); + + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled after system call. @@ -653,6 +667,7 @@ __thr_interpose_libc(void) SLOT(wait6); SLOT(ppoll); SLOT(map_stacks_exec); + SLOT(fdatasync); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = -- cgit v1.1