diff options
author | kib <kib@FreeBSD.org> | 2016-08-29 05:37:03 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-08-29 05:37:03 +0000 |
commit | 09b81d30ae629d75d03972b872eab71e24605bb6 (patch) | |
tree | f0c2fcd24a02aa2f753b25937950603a6eabf3be /lib/libthr/thread | |
parent | fd2de0ec5da557cf8b56bdc4da12d66bbd506603 (diff) | |
download | FreeBSD-src-09b81d30ae629d75d03972b872eab71e24605bb6.zip FreeBSD-src-09b81d30ae629d75d03972b872eab71e24605bb6.tar.gz |
MFC r304209:
The fdatasync(2) call must be cancellation point.
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_syscalls.c | 15 |
1 files changed, 15 insertions, 0 deletions
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)) = |