Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com X-WM-Posted-At: avacado.atomice.net; Tue, 28 May 02 22:24:49 +0100 Message-ID: <008601c2068e$193b6200$0100a8c0@advent02> From: "Chris January" To: Subject: Question about process enumeration and _pinfo structure Date: Tue, 28 May 2002 22:24:49 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 I want to add a member to the _pinfo structure which contains the command line originally passed to the process. At the moment, when the Cygwin DLL needs a list of the current Cygwin processes it uses winpids to enumerate the processes and the _pinfo structures for each Cygwin process are copied from a named file mapping. So to store the command line I either need to: i) make the command line an in-line array, e.g. char cmdline[1024]; or ii) make the member a pointer to a string allocated on the cygwin heap. The first would work, but would set a limit on the size of command line. (I believe there are several other, conflicting, limits elsewhere so this shouldn't be a problem). The second would also work, but would tie the _pinfo structure to a specific instance of the Cygwin DLL. Now I know there's supposed to be only one instance of the DLL running on the system anyway, which leads me to the following question: Why are the processes enumerated in this fashion rather than an array or linked list of _pinfo's stored in the shared_info structure? Is this just historical (i.e. noone got round to changing it) or is there some reasoning behind it? Chris