int error, numevents, size; 
int numevents, size; 
sys32_epoll_wait(int epfd, struct epoll_event32 __user * events, int maxevents,		 int timeout){	struct epoll_event *events64 = NULL;	mm_segment_t old_fs = get_fs();	int error, numevents, size;	int evt_idx;	int do_free_pages = 0;	if (maxevents <= 0) {		return -EINVAL;	}	/* Verify that the area passed by the user is writeable */	if (!access_ok(VERIFY_WRITE, events, maxevents * sizeof(struct epoll_event32)))		return -EFAULT;	/* 	 * Allocate space for the intermediate copy.  If the space needed	 * is large enough to cause kmalloc to fail, then try again with	 * __get_free_pages.	 */	size = maxevents * sizeof(struct epoll_event);	events64 = kmalloc(size, GFP_KERNEL);	if (events64 == NULL) {		events64 = (struct epoll_event *)				__get_free_pages(GFP_KERNEL, get_order(size));		if (events64 == NULL)			return -ENOMEM;		do_free_pages = 1;	}	/* Do the system call */	set_fs(KERNEL_DS); /* copy_to/from_user should work on kernel mem*/	numevents = sys_epoll_wait(epfd, (struct epoll_event __user *) events64,				   maxevents, timeout);	set_fs(old_fs);	/* Don't modify userspace memory if we're returning an error */	if (numevents > 0) {		/* Translate the 64-bit structures back into the 32-bit		   structures */		for (evt_idx = 0; evt_idx < numevents; evt_idx++) {			__put_user(events64[evt_idx].events,				   &events[evt_idx].events);			__put_user((u32)events64[evt_idx].data,				   &events[evt_idx].data[0]);			__put_user((u32)(events64[evt_idx].data >> 32),				   &events[evt_idx].data[1]);		}	}	if (do_free_pages)		free_pages((unsigned long) events64, get_order(size));	else		kfree(events64);	return numevents;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d8caebd285a084ee1e4d484ce597865228614067/sys_ia32.c/clean/arch/ia64/ia32/sys_ia32.c