aboutsummaryrefslogtreecommitdiff
path: root/cddl
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-10-16 07:41:33 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-10-16 07:41:33 +0000
commitba2bbaffcf9115da3f779f7d82947878444ba3d1 (patch)
tree7fbd4fa7f2ccc1776235b2d33374eb947a2d7201 /cddl
parentc67a6b9c7f8792ac775dccde3027c9e2073b128a (diff)
downloadsrc-ba2bbaffcf9115da3f779f7d82947878444ba3d1.tar.gz
src-ba2bbaffcf9115da3f779f7d82947878444ba3d1.zip
zfs: add a lame emulation of cv_wait_sig(9) in userland to fix r353618
Not sure if we need anything better. Maybe we should try to port illumos libfakekernel or provide something similar natively. MFC after: 4 weeks X-MFC with: r353618
Notes
Notes: svn path=/head/; revision=353625
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/kernel.c12
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
index fb1d6f89aeb7..6b056b7ff6b2 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
@@ -321,6 +321,18 @@ cv_wait(kcondvar_t *cv, kmutex_t *mp)
mp->m_owner = curthread;
}
+/*
+ * NB: this emulates FreeBSD cv_wait_sig(9), not the illumos one.
+ * Meanings of the return code is different.
+ * NB: this does not actually catch any siganls.
+ */
+int
+cv_wait_sig(kcondvar_t *cv, kmutex_t *mp)
+{
+ cv_wait(cv, mp);
+ return (0);
+}
+
clock_t
cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime)
{
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
index e93ca2f4ad7b..30d50dd8a25b 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
@@ -330,6 +330,7 @@ typedef cond_t kcondvar_t;
extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg);
extern void cv_destroy(kcondvar_t *cv);
extern void cv_wait(kcondvar_t *cv, kmutex_t *mp);
+extern int cv_wait_sig(kcondvar_t *cv, kmutex_t *mp);
extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime);
extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
hrtime_t res, int flag);