PERFORCE change 136828 for review

Roman Divacky rdivacky at FreeBSD.org
Tue Mar 4 17:02:13 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=136828

Change 136828 by rdivacky at 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);
 }


More information about the p4-projects mailing list