From owner-p4-projects@FreeBSD.ORG Tue Mar 4 17:02:13 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 060611065673; Tue, 4 Mar 2008 17:02:13 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9F9D1065671 for ; Tue, 4 Mar 2008 17:02:12 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AAE8D8FC1F for ; Tue, 4 Mar 2008 17:02:12 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m24H2C6J024806 for ; Tue, 4 Mar 2008 17:02:12 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m24H2CFS024804 for perforce@freebsd.org; Tue, 4 Mar 2008 17:02:12 GMT (envelope-from rdivacky@FreeBSD.org) Date: Tue, 4 Mar 2008 17:02:12 GMT Message-Id: <200803041702.m24H2CFS024804@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 136828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2008 17:02:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=136828 Change 136828 by rdivacky@rdivacky_witten on 2008/03/04 17:01:27 Some comment changes + printf and change from EINVAL to ENOSYS for some operation we dont support yet. Suggested by: netchild Affected files ... .. //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.c#10 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.c#10 (text+ko) ==== @@ -57,7 +57,9 @@ if (args->size <= 0) return (EINVAL); - /* args->size is unused. Linux ignores it as well. */ + /* + * args->size is unused. Linux just tests it + * and then forgets it as well. */ return (kqueue(td, &k_args)); } @@ -140,7 +142,9 @@ /* * Copyin callback used by kevent. This copies already - * converted filters to the kevent internal memory. + * converted filters from kernel memory to the kevent + * internal kernel memory. Hence the memcpy instead of + * copyin. */ static int linux_kev_copyin(void *arg, struct kevent *kevp, int count) @@ -193,7 +197,8 @@ break; case LINUX_EPOLL_CTL_MOD: /* TODO: DELETE && ADD maybe? */ - return (EINVAL); + printf("linux_epoll_ctl: CTL_MOD not yet implemented.\n"); + return (ENOSYS); break; case LINUX_EPOLL_CTL_DEL: kev.flags = EV_DELETE | EV_DISABLE; @@ -241,6 +246,9 @@ error = kern_kevent(td, args->epfd, 0, args->maxevents, &k_ops, &ts); - /* translation? */ + /* + * kern_keven might return ENOMEM which is not expected from epoll_wait. + * Maybe we should translate that but I don't think it matters at all. + */ return (error); }