aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_syscalls.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-08-16 08:27:03 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-08-16 08:27:03 +0000
commit1c1cc89580f0fbfabaf6f6c7f0f6440eef0c128e (patch)
treedf3c35f3537a5e65ae1edabff7f1c3352b8f17fd /lib/libthr/thread/thr_syscalls.c
parentb0754a31cfa10fa27b1fad91461c55929577c929 (diff)
downloadsrc-1c1cc89580f0fbfabaf6f6c7f0f6440eef0c128e.tar.gz
src-1c1cc89580f0fbfabaf6f6c7f0f6440eef0c128e.zip
The fdatasync(2) call must be cancellation point.
Sponsored by: The FreeBSD Foundation MFC after: 13 days
Notes
Notes: svn path=/head/; revision=304209
Diffstat (limited to 'lib/libthr/thread/thr_syscalls.c')
-rw-r--r--lib/libthr/thread/thr_syscalls.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c
index 712249b1e573..362826ca2f91 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)) =