Subject: Re: keeping the process start time in core at all times...
To: David Laight <david@l8s.co.uk>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 12/02/2002 22:41:42
David Laight wrote:

> sysclt_doeproc() has the following structure:
> 
>     proclist_lock_read();
> 
>     for (p = LIST_FIRST(pd->pd_list); p != NULL; p = LIST_NEXT(p, p_list)) {
> 	    ...
> 	    error = copyout(&kproc2, dp2, ... )
> 	    ...
>     }
>     proclist_unlock_read();
> 
> This means it can sleep with the proclist read locked.

See the calls to uvm_vslock() and uvm_vsunlock() in sys___sysctl() to
lock down any user memory that is the destination of copyout().

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/