*/
/* arbitrary limits */
#define MAX_SAMPLES 256
-#define MAX_INSNS 10
static int do_insnlist_ioctl(comedi_device *dev,void *arg,void *file)
{
comedi_insnlist insnlist;
if(copy_from_user(&insnlist,arg,sizeof(comedi_insnlist)))
return -EFAULT;
- if(insnlist.n_insns>=MAX_INSNS){
- DPRINTK("insnlist too long\n");
- return -EINVAL;
- }
-
data=kmalloc(sizeof(lsampl_t)*MAX_SAMPLES,GFP_KERNEL);
if(!data){
DPRINTK("kmalloc failed\n");
goto error;
}
}
+ if(need_resched())
+ schedule();
}
error:
#define signal_pending(x) (((x)->signal) & (~(x)->blocked))
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20) /* not sure exactly when need_resched() was added */
+static inline int need_resched(void)
+{
+ return current->need_resched;
+}
+#endif
+
#include_next <linux/sched.h>
#endif