Re: [PATCH] waitid system call

From: Roland McGrath
Date: Tue Aug 31 2004 - 18:57:56 EST


Andrew, please replace waitid-clear-fields.patch with this one.
The old log entry is still good.


Thanks,
Roland

--- linux-2.6.9-rc1-mm1/kernel/exit.c.~1~
+++ linux-2.6.9-rc1-mm1/kernel/exit.c
@@ -1369,8 +1369,19 @@ check_continued:
end:
current->state = TASK_RUNNING;
remove_wait_queue(&current->wait_chldexit,&wait);
- if (infop && retval > 0)
- retval = 0;
+ if (infop) {
+ if (retval > 0)
+ retval = 0;
+ else if (retval == 0) {
+ /*
+ * For a WNOHANG return, clear out all the fields
+ * we would set so the user can easily tell the
+ * difference.
+ */
+ if (clear_user(infop, sizeof *infop))
+ retval = -EFAULT;
+ }
+ }
return retval;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/