if (nfds > fdt->max_fdset && nfds > OPEN_MAX) 
max_fdset = fdt->max_fdset; rcu_read_unlock(); if (nfds > max_fdset && nfds > OPEN_MAX) 
asmlinkage long sys_poll(struct pollfd __user * ufds, unsigned int nfds, long timeout){	struct poll_wqueues table; 	int fdcount, err; 	unsigned int i;	struct poll_list *head; 	struct poll_list *walk;	struct fdtable *fdt;	/* Do a sanity check on nfds ... */	fdt = files_fdtable(current->files);	if (nfds > fdt->max_fdset && nfds > OPEN_MAX)		return -EINVAL;	if (timeout) {		/* Careful about overflow in the intermediate values */		if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ)			timeout = (unsigned long)(timeout*HZ+999)/1000+1;		else /* Negative or overflow */			timeout = MAX_SCHEDULE_TIMEOUT;	}	poll_initwait(&table);	head = NULL;	walk = NULL;	i = nfds;	err = -ENOMEM;	while(i!=0) {		struct poll_list *pp;		pp = kmalloc(sizeof(struct poll_list)+				sizeof(struct pollfd)*				(i>POLLFD_PER_PAGE?POLLFD_PER_PAGE:i),					GFP_KERNEL);		if(pp==NULL)			goto out_fds;		pp->next=NULL;		pp->len = (i>POLLFD_PER_PAGE?POLLFD_PER_PAGE:i);		if (head == NULL)			head = pp;		else			walk->next = pp;		walk = pp;		if (copy_from_user(pp->entries, ufds + nfds-i, 				sizeof(struct pollfd)*pp->len)) {			err = -EFAULT;			goto out_fds;		}		i -= pp->len;	}	fdcount = do_poll(nfds, head, &table, timeout);	/* OK, now copy the revents fields back to user space. */	walk = head;	err = -EFAULT;	while(walk != NULL) {		struct pollfd *fds = walk->entries;		int j;		for (j=0; j < walk->len; j++, ufds++) {			if(__put_user(fds[j].revents, &ufds->revents))				goto out_fds;		}		walk = walk->next;  	}	err = fdcount;	if (!fdcount && signal_pending(current))		err = -EINTR;out_fds:	walk = head;	while(walk!=NULL) {		struct poll_list *pp = walk->next;		kfree(walk);		walk = pp;	}	poll_freewait(&table);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b835996f628eadb55c5fb222ba46fe9395bf73c7/select.c/clean/fs/select.c