delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/22/16:28:19

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Reply-To: <don AT beusee DOT com>
From: "Don Beusee" <don AT beusee DOT com>
To: <cygwin AT cygwin DOT com>
References: <050f01ca9b07$df859370$9e90ba50$@com> <416096c61001212102q8b38104s814fd15688957d3a AT mail DOT gmail DOT com>
In-Reply-To: <416096c61001212102q8b38104s814fd15688957d3a@mail.gmail.com>
Subject: RE: Why require ps -W and kill -f
Date: Fri, 22 Jan 2010 13:28:05 -0800
Message-ID: <057e01ca9ba9$c9d6b430$5d841c90$@com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

People don't care about implementation details.  They care about what is ru=
nning on the system (the WHOLE system).  They want kill and ps to show what=
's running on the system, not what cygwin "thinks" is running.  Since exec(=
) creates a new process on windows, that's more relevant for these tools.

You have to admit, ps -ef showing only a few processes out of a houndred is=
 a serious handicap for these tools and any scripts trying to maintain comp=
atibility across windows and unix/linux.  Also, the man page for -e (on uni=
x/linux) says that -e means "every process on the system".

It will be more useful to show all windows processes, or if you want to be =
smart about it, all windows processes minus all the ones cygwin knows are t=
he result of exec().  However, I think the exec() distinction doesn't reall=
y matter (certainly not to most people), since, how often will you really s=
ee it and how often will it really matter?  I don't see what's the big deal=
 to allow ps and kill to see all windows processes by default.

How about let the user control how this works without having to change scri=
pts or typing habits?  Can you add a new option via the CYGWIN environment =
variable, something like [no]allprocs which kill and ps can look at instead=
 of -f and -W options (although you can keep those for compatibility with e=
xisting cygwin releases)?  Of course, I think the default behavior should b=
e allprocs, since I believe almost all users will prefer this behavior.

-Don


-----Original Message-----
From: Andy Koppe [mailto:andy DOT koppe AT gmail DOT com]=20
Sent: Thursday, January 21, 2010 9:02 PM
To: don AT beusee DOT com; cygwin AT cygwin DOT com
Subject: Re: Why require ps -W and kill -f

2010/1/22 Don Beusee:
> ps -e on Unix displays =EF=BF=BDevery process running on the system=EF=BF=
=BD.=EF=BF=BD This command
> doesn't do that under cygwin.=EF=BF=BD Why should it be necessary to supp=
ly -W to
> see all processes running on the system?

Because those processes are not Cygwin/Unix processes. In particular,
they do not have Cygwin process IDs. Cygwin PIDs and Windows PIDs are
different concepts (even though they often coincide), and that's
because multiple windows processes can be needed to emulate one Cygwin
process. For example, when calling exec(), the new program is
conceptually executed in the same Cygwin process, but actually a new
Windows process has to be created since Windows doesn't allow a
process to change executable.

Andy


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019