qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s


From: Jamie Lokier
Subject: Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s
Date: Wed, 5 Nov 2008 15:00:42 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

M. Warner Losh wrote:
> : In other words, don't use pselect() if you might run on a kernel older
> : than 2.6.16, or on a host architecture which adds pselect() in a later
> : kernel version.  Also, I wouldn't be surprised if older versions of
> : some BSDs have similar dodgy wrappers.
> 
> Which ones have a good kernel implementation of it?  FreeBSD's is
> currently approximately:
> 
>       if (!mask)
>               _sigprocmask(mask, &oldmask);
>       /* here */
>       select();
>       if (!mask)
>               _sigprocmask(oldmask, NULL);
> 
> I'm assuming that the problem is due to a signal arriving at /* here */.

If that's _kernel_ code and the kernel behaves like Linux, it's not a
problem because signals don't affect the control flow until returning
to userspace, meaning the select() will return EINTR.

If that's userspace (libc) code, then it is no good.  Nobody should
ever have written crappy pselect() wrappers in userspace (i.e. Glibc),
it just causes portable software to have to keep a whitelist of
reliable pselect() platforms (i.e. not Linux) instead of just using
it.  Same for crappy broken pread() and pwrite() wrappers.

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]