From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <30e8c9fe88deefa3ede46aec7b2f75c8@quintile.net> From: "Steve Simon" Date: Wed, 13 Aug 2008 00:13:21 +0100 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] another kernel question Topicbox-Message-UUID: fd8c864a-ead3-11e9-9d60-3106f5b1d025 I have found another piece of code I don't understand in the kernel. syscalls are all fed through a single trap, and the common code which processes them performs a waserror(): /sys/src/9/pc/trap.c:694 A few lines down this function (after the system call has been executed up->nerrlab is checked to ensure we have matching poperror()s for each waserror() during the execution of said call. this is fine for most calls, however rfork() explicitly sets up->nerrlab to zero rather than copying it and memmove()ing up->errlab from the parent proc to the child: /sys/src/9/port/sysproc.c:90 Surely this means that rfork will always fail with a "bad errstack [19]: -1 extra" error? Clearly this doesn't happen but I doin't understand how why it works. anyone? -Steve