Re: [PATCH] sys_select() kmallocs 0 bytes.

From: Artur Skawina (skawina@geocities.com)
Date: Sat May 27 2000 - 08:08:48 EST


> Can you elaborate on this? I'm not disputing it, but I'd like to
> understand what difference things make if the kmalloc isnt taken.
>
> My understanding is that with the existing code, if n=0, we kmalloc 0
> bytes, fail, and goto out_nofds. With my patch, if n=0, we goto out_nofds.
> (Or am I missing something obvious here?)

kmalloc(0,GFP_KERNEL)!=0

> The 'We ought to optimise the n=0 case - it is used enough.'
> kind of made me scratch my head a little too..

int usleep(unsigned usec)
{
   struct timeval tval;
   tval.tv_sec = 0;
   tval.tv_usec = usec;
   return select( 0, NULL, NULL, NULL, &tval );
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:17 EST