Re: First draft list of 2.3.x "Things to fix"

From: Matthias Urlichs (smurf@noris.de)
Date: Sat Jan 08 2000 - 04:10:35 EST


  Bill Wendling <wendling@ganymede.isdn.uiuc.edu> writes:
> Sorry if this has been commented on before, but is there more information
> on this?
>
Try it yourself:

 {fd=99998, events=POLLIN}, {fd=99999, events=POLLIN}, {fd=100000, events=POLLIN}, {fd=100001, events=POLLIN}, {fd=100002, events=POLLIN}, {fd=100003, events=POLLIN}], 100000, 10) = -1 ENOMEM (Cannot allocate memory)

16384 is the limit, actually.

#include <poll.h>
#include <malloc.h>
#include <sys/file.h>
main(int argc,char *argv[]) {
    int n = atoi(argv[1]);
    int i;
    struct pollfd *p;
    printf("Do %d\n",n);
    p=malloc(sizeof(*p)*n);
    for(i=0;i<n;i++) {
        p[i].fd=1;
        p[i].events=POLLOUT;
    }
    i = poll(p,n,10);
    if(i < 0)
        printf("Poll: %m\n");
    else
        printf("Poll: %d\n",i);
}

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
My superiority complex is better than your superiority complex

- 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 : Sat Jan 15 2000 - 21:00:12 EST