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
This commit is contained in:
Andriy Gapon 2019-10-16 07:41:33 +00:00
parent c67a6b9c7f
commit ba2bbaffcf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353625
2 changed files with 13 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);