[OpenAFS-devel] Same problem in a different place.

Nickolai Zeldovich kolya@MIT.EDU
Fri, 01 Feb 2002 15:49:42 -0500


> Actually, since afs_osi_Sleep() and CV_WAIT() are used so frequently, it 
> might be easier to make just make two new calls:
> 
>    int afs_osi_SleepHonorSig(char *event, int aintrok);
>    int CV_WAIT_HONORSIG(afs_kcondvar_t *cv, afs_kmutex_t *l, int aintrok)

I've just commited code to CVS which does basically that.  The two new
sleep functions are:

   int afs_osi_SleepSig(char *event);
   int CV_WAIT_SIG(afs_kcondvar_t *cv, afs_kmutex_t *l);

They return EINTR if interrupted by a signal, and 0 otherwise.  They're
actually implemented for Linux and Solaris, and are wrappers around the
existing non-interruptable functions on all other platforms.  I've also
made afs_UFSRead() interruptible, at least in the case when the work is
being done by a background daemon, just to make sure all this works.

My one concern at this point is signal handlers with SA_RESTART: some
limited testing on my 2.4.17 Linux box indicates that the system call
isn't being restarted, and returns when the signal is delivered, rather
than restarting.  Do you happen to know how SA_RESTART is supposed to
work inside the kernel?

-- kolya