ircu2.10.12 pk910 fork
[ircu2.10.12-pk.git] / doc / linux-poll.patch
1 *** ./select.c.bak      Sun Apr 30 13:00:38 2000
2 --- /usr/src/linux/fs/select.c  Mon May  1 18:00:15 2000
3 ***************
4 *** 11,16 ****
5 --- 11,17 ----
6    */
7   
8   #include <linux/malloc.h>
9 + #include <linux/vmalloc.h>
10   #include <linux/smp_lock.h>
11   #include <linux/poll.h>
12   #include <linux/file.h>
13 ***************
14 *** 416,422 ****
15         }
16   
17         size = nfds * sizeof(struct pollfd);
18 !       fds = (struct pollfd *) kmalloc(size, GFP_KERNEL);
19         if (!fds)
20                 goto out;
21   
22 --- 417,426 ----
23         }
24   
25         size = nfds * sizeof(struct pollfd);
26 !       if (size > PAGE_SIZE) 
27 !               fds = (struct pollfd *) vmalloc(size);
28 !       else
29 !               fds = (struct pollfd *) kmalloc(size, GFP_KERNEL);
30         if (!fds)
31                 goto out;
32   
33 ***************
34 *** 437,443 ****
35                 err = -EINTR;
36   
37   out_fds:
38 !       kfree(fds);
39   out:
40         if (wait)
41                 free_wait(wait_table);
42 --- 441,450 ----
43                 err = -EINTR;
44   
45   out_fds:
46 !       if (size > PAGE_SIZE) 
47 !               vfree(fds);
48 !       else
49 !               kfree(fds);
50   out:
51         if (wait)
52                 free_wait(wait_table);