From owner-freebsd-standards@FreeBSD.ORG Sun Mar 21 17:09:21 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0572816A4CE for ; Sun, 21 Mar 2004 17:09:21 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFDAD43D39 for ; Sun, 21 Mar 2004 17:09:20 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2M19KoP011691 for ; Sun, 21 Mar 2004 20:09:20 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Sun, 21 Mar 2004 20:09:19 -0500 To: freebsd-standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 01:09:21 -0000 At 3:51 PM -0500 3/20/04, Garance A Drosihn wrote: > >The update weighs in at almost 900 lines, and is available at: >http://people.freebsd.org/~gad/ps-susv3.diff I should mention that right now my intent is to commit all of this to -current next weekend (Mar 27th), unless there are any questions still pending about it. It's possible that I'll have to delay the commit simply because I'm too busy to get to it, but at least for right now that is my target date... At 5:21 PM -0500 3/20/04, Garance A Drosihn wrote: >For `-U', there is a minor change in error-processing behavior >which should probably be done to match the standards, and to >match how other operating systems handle the same errors. But >I did not make that change, because it was possible someone >cares about the present behavior. .... >Would it be alright if I changed that to a fatal error, and >thus removed the ten lines of comments where I'm wringing my >hands in angst over making that change? I think that what I'm going to for this is to commit it as I have it right now (keep the present "warning-only" behavior), and then commit a second commit to change that to a "fatal error" behavior. I'll probably also break out the '-g' change to a separate update, so I'll have one big update which should be "completely backwards compatible", and then two tiny updates which change make the minor incompatible changes. If I do that right, the big update could eventually be MFC'ed to 4.x. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 04:09:19 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F80C16A4CE; Mon, 22 Mar 2004 04:09:19 -0800 (PST) Received: from phuket.psconsult.nl (ps226.psconsult.nl [213.222.19.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD14F43D31; Mon, 22 Mar 2004 04:09:18 -0800 (PST) (envelope-from fb-standards@psconsult.nl) Received: from phuket.psconsult.nl (localhost [127.0.0.1]) by phuket.psconsult.nl (8.12.8p2/8.12.8) with ESMTP id i2MC9HYe009565; Mon, 22 Mar 2004 13:09:17 +0100 (CET) (envelope-from fb-standards@psconsult.nl) Received: (from paul@localhost) by phuket.psconsult.nl (8.12.8p2/8.12.8/Submit) id i2MC9GXM009564; Mon, 22 Mar 2004 13:09:16 +0100 (CET) Date: Mon, 22 Mar 2004 13:09:16 +0100 From: Paul Schenkeveld To: Garance A Drosihn Message-ID: <20040322120916.GA9002@psconsult.nl> Mail-Followup-To: Garance A Drosihn , freebsd-standards@freebsd.org, freebsd-arch@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 12:09:19 -0000 Hi, On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote: > [this is BCC'ed to -arch so more people have a chance to see it, but > I expect most of the discussion to happen in freebsd-standards]. > > ... Any chance this can be adapted for RELENG_4 or do you think the ps source has changed too much between RELENG_4 and HEAD? Of course I tried a quick patch using 4.9-STABLE sources but most chunks failed. A patch and make using HEAD sources showes too many #include differences. I can spend some time to adapt for RELENG_4 if I know that there's a chance of success but I'm not to familiar with the changes between 4 and 5. > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu Regards, Paul Schenkeveld, Consultant PSconsult ICT Services BV From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 04:47:05 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7866316A4CE; Mon, 22 Mar 2004 04:47:05 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 044A443D1D; Mon, 22 Mar 2004 04:47:05 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B5OqM-00089s-Pp; Mon, 22 Mar 2004 18:47:50 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2MCmG2a078329; Mon, 22 Mar 2004 18:48:16 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2MCmGWp078327; Mon, 22 Mar 2004 18:48:16 +0600 (NOVT) (envelope-from danfe) Date: Mon, 22 Mar 2004 18:48:15 +0600 From: Alexey Dokuchaev To: Garance A Drosihn , freebsd-standards@freebsd.org, freebsd-arch@freebsd.org Message-ID: <20040322124815.GA76254@regency.nsu.ru> References: <20040322120916.GA9002@psconsult.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040322120916.GA9002@psconsult.nl> User-Agent: Mutt/1.4.1i Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 12:47:05 -0000 On Mon, Mar 22, 2004 at 01:09:16PM +0100, Paul Schenkeveld wrote: > Hi, > > On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote: > > [this is BCC'ed to -arch so more people have a chance to see it, but > > I expect most of the discussion to happen in freebsd-standards]. > > > > ... > > Any chance this can be adapted for RELENG_4 or do you think the > ps source has changed too much between RELENG_4 and HEAD? I personally do not see that much need in putting anything more than a trivial effort in bringing this stuff to RELENG_4. 4.x is living its life out, and this change is not something that 4.x definitely must have. General practice here is most probably is: unless there's a stong reason (like security one) or it's a trivial change, don't MFC. Deed is not worth the trouble. ./danfe From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 07:34:59 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F89C16A4CE for ; Mon, 22 Mar 2004 07:34:59 -0800 (PST) Received: from mxsf09.cluster1.charter.net (mxsf09.cluster1.charter.net [209.225.28.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22BF843D3F for ; Mon, 22 Mar 2004 07:34:59 -0800 (PST) (envelope-from archie@dellroad.org) Received: from InterJet.dellroad.org (E6V6Q8.cpe.mvllo.al.charter.com [24.196.29.251])i2MFU31l011025; Mon, 22 Mar 2004 10:30:04 -0500 (EST) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.2.2.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id JAA63658; Mon, 22 Mar 2004 09:22:13 -0600 (CST) Received: from arch20m.dellroad.org (localhost [127.0.0.1]) i2MFM6GN004119; Mon, 22 Mar 2004 09:22:06 -0600 (CST) (envelope-from archie@arch20m.dellroad.org) Received: (from archie@localhost) by arch20m.dellroad.org (8.12.9p2/8.12.9/Submit) id i2MFM5CO004118; Mon, 22 Mar 2004 09:22:05 -0600 (CST) (envelope-from archie) From: Archie Cobbs Message-Id: <200403221522.i2MFM5CO004118@arch20m.dellroad.org> In-Reply-To: <20040319102323.Q23424@gamplex.bde.org> To: Bruce Evans , Garrett Wollman Date: Mon, 22 Mar 2004 09:22:05 -0600 (CST) X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: freebsd-standards@FreeBSD.ORG Subject: Re: _BSD_SOURCE vs. __BSD_VISIBLE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 15:34:59 -0000 Bruce Evans wrote: > > Q1: Why does Linux require _BSD_SOURCE but FreeBSD requires __BSD_VISIBLE? > > Linux apparently requires _BSD_SOURCE to give BSD extensions. This is > a bug in Linux. The BSD extensions are better of course :-), and feature > tests macros should generally restrict, not enable extensions. I think > Linux does this because some BSD extensions are incompatible. Thanks to all for the clarifications on this question. Problem is now resolved, in that now for my application FreeBSD compilations requires no flags, while on Linux _BSD_SOURCE is required. Knowing that Linux, rather than FreeBSD, requires the special hack to compile correctly is more consistent with my existing world view :-) Thanks, -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 07:59:03 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A798B16A4CE for ; Mon, 22 Mar 2004 07:59:03 -0800 (PST) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED14143D31 for ; Mon, 22 Mar 2004 07:59:02 -0800 (PST) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:2e0:81ff:fe22:51d8]) by mailhost.stack.nl (Postfix) with ESMTP id 405F0D46#152D81F006; Mon, 22 Mar 2004 16:59:02 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id D9EB01CC2E; Mon, 22 Mar 2004 16:59:01 +0100 (CET) Date: Mon, 22 Mar 2004 16:59:01 +0100 From: Jilles Tjoelker To: Garance A Drosihn Message-ID: <20040322155901.GA17891@stack.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 5.2.1-RELEASE-p1 i386 User-Agent: Mutt/1.5.6i cc: freebsd-standards@FreeBSD.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 15:59:03 -0000 On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote: > It started out that I just wanted to get rid of one message that > `ps' writes to stderr in -current but not in -stable. "As long as > I was there", I thought I'd add support for a comma-separated list > of processes for `ps -p' (as described in SUSv3). Alexey Dokuchaev > asked if this change got us much closer to POSIX/SUS. Now it did > get us a *little* closer, but in re-reading SUSv3 I realized that > I didn't get it (that one option) quite as close as I would like. > So, "as long as I was there", I figured I should try to come a > little closer. > Now, after about 30 consecutive "as long as I was there" small > projects, I have an update which: > [snip good stuff] > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > (note that this replaced a null `-g' option...) Old BSD ps used to exclude process group leaders unless `-g' or `-x' were given. > Adds a `-R ruserlist' option, which is the same as what > SYSv3 describes for `-u' (we already have a `-u'). > Amazingly, none of solaris, linux, or irix seem to > have any kind of `-R' option. SUSv3 says -u selects by effective uid and -U selects by real uid. FreeBSD -U selects by effective uid and -u is something else totally. This is only of the (few) obstacles to SUSv3 (not XSI) compatibility (another being the default selection). XSI level compatibility would require a lot of POLA violation. > [snip] > Fixes interactions between all these "selector options", > & our `-x' option (which is not mentioned in SUSv3). > For the selector options, I tried to meet the > description of: "If any are specified, the default > list shall be ignored and ps shall select the > processes represented by the inclusive OR of all > the selection-criteria options." Hmm, this means the user must add `-x' if `-U', `-s', etc. are used and he wants to see all matching processes. That's not good for writing scripts that should work on both Solaris and FreeBSD, for example. Also, `-U' used to imply `-x' on FreeBSD (it does not on NetBSD). I propose making it so that `-x' is implied when any selector except `-a' is used. > [snip] Jilles Tjoelker From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 09:11:21 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA2B316A4CE for ; Mon, 22 Mar 2004 09:11:21 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 592EC43D70 for ; Mon, 22 Mar 2004 09:11:21 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2MHBKEw020250; Mon, 22 Mar 2004 12:11:20 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040322120916.GA9002@psconsult.nl> References: <20040322120916.GA9002@psconsult.nl> Date: Mon, 22 Mar 2004 12:11:19 -0500 To: Paul Schenkeveld From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 17:11:21 -0000 At 1:09 PM +0100 3/22/04, Paul Schenkeveld wrote: > >On Sat, Mar 20, 2004, Garance A Drosihn wrote: > > [this is BCC'ed to -arch so more people have a chance to see it, but >> I expect most of the discussion to happen in freebsd-standards]. >> > > ... > >Any chance this can be adapted for RELENG_4 or do you think the >ps source has changed too much between RELENG_4 and HEAD? I intend to MFC at least some of it. I will avoid anything that would change how something currently works in 4.x, but I hope to add some of the "new features". >Of course I tried a quick patch using 4.9-STABLE sources but most >chunks failed. A patch and make using HEAD sources showes too many >#include differences. You're seeing those due to a few previous updates which were not MFC'ed. When I did a quick skim of those, most of those seemed to be cosmetic. Again, I don't intend to MFC anything that changes the behavior of 'ps', but I'll see what I can do about cosmetic (aka style(9)) changes. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 10:18:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2ED4416A4CF; Mon, 22 Mar 2004 10:18:25 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC1D243D45; Mon, 22 Mar 2004 10:18:24 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2MIINHB016764; Mon, 22 Mar 2004 13:18:24 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040322155901.GA17891@stack.nl> References: <20040322155901.GA17891@stack.nl> Date: Mon, 22 Mar 2004 13:18:22 -0500 To: Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 18:18:25 -0000 At 4:59 PM +0100 3/22/04, Jilles Tjoelker wrote: >On Sat, Mar 20, 2004, Garance A Drosihn wrote: > >> Adds a `-R ruserlist' option, which is the same as what >> SYSv3 describes for `-u' (we already have a `-u'). >> Amazingly, none of solaris, linux, or irix seem to >> have any kind of `-R' option. > >SUSv3 says -u selects by effective uid and -U selects by real uid. >FreeBSD -U selects by effective uid and -u is something else totally. >This is only of the (few) obstacles to SUSv3 (not XSI) compatibility >(another being the default selection). XSI level compatibility would >require a lot of POLA violation. Ugh. I kept thinking I was reading that one backwards, but somehow I managed to keep convincing myself that I had it right. Well, I am not comfortable suggesting that we change -U's definition this far into the life of 5.x. That could be pretty confusing (even though it is a subtle change). Great. So what should I do here? Add a `-E' option for "effective userid"? In fact, add both `-E' and `-R', and then we would have two options that we could MFC into 4.x as well as 5.x (without any conflict). At some later date (in 6.x?), we would have the option of changing '-U' to match the standard definition. Amazingly, both `-E' and `-R' seem to be unused on the other OS's I have here. I am not thrilled with that idea, but at the moment I can't think of a better one. I *would* like to support matches of both real and effective users. I guess we could add some other option which would say "use the POSIX definitions of -u and -U", but that doesn't exactly thrill me either. Anyone have any other suggestions? Should I just leave it alone for now? -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 10:18:33 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FED416A4CF for ; Mon, 22 Mar 2004 10:18:33 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9A5343D2F for ; Mon, 22 Mar 2004 10:18:32 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2MIIWLP004025; Mon, 22 Mar 2004 13:18:32 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040322155901.GA17891@stack.nl> References: <20040322155901.GA17891@stack.nl> Date: Mon, 22 Mar 2004 13:18:30 -0500 To: Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 18:18:33 -0000 At 4:59 PM +0100 3/22/04, Jilles Tjoelker wrote: >On Sat, Mar 20, 2004, Garance A Drosihn wrote: > > [snip] >> Fixes interactions between all these "selector options", >> & our `-x' option (which is not mentioned in SUSv3). >> For the selector options, I tried to meet the >> description of: "If any are specified, the default >> list shall be ignored and ps shall select the >> processes represented by the inclusive OR of all >> the selection-criteria options." > >Hmm, this means the user must add `-x' if `-U', `-s', etc. are used >and he wants to see all matching processes. That's not good for >writing scripts that should work on both Solaris and FreeBSD, for >example. Also, `-U' used to imply `-x' on FreeBSD (it does not on >NetBSD). > >I propose making it so that `-x' is implied when any selector >except `-a' is used. Well, my follow-up message explained my reasoning for this in more detail, but your logic seems pretty reasonable too. If I do this, I'll add a -X option which would "turn off -x", so to speak. There are times where I don't want to see the extra processes. A `-X' option does not seem to conflict with solaris, aix, or irix. Linux does have a -X, but it's for "old Linux i386 register format", and I think we can safely assume we would never implement that, and that it is also not likely to become a "standard" option... I think I'll do it that way. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Mon Mar 22 11:01:36 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20D2A16A4D1 for ; Mon, 22 Mar 2004 11:01:36 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0662643D41 for ; Mon, 22 Mar 2004 11:01:36 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i2MJ1Zbv058392 for ; Mon, 22 Mar 2004 11:01:35 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2MJ1Z4V058386 for freebsd-standards@freebsd.org; Mon, 22 Mar 2004 11:01:35 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 22 Mar 2004 11:01:35 -0800 (PST) Message-Id: <200403221901.i2MJ1Z4V058386@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 19:01:36 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- s [2001/01/23] misc/24590 standards timezone function not compatible witn Sin o [2001/03/05] bin/25542 standards /bin/sh: null char in quoted string o [2002/02/25] bin/35307 standards standard include files are not standard c o [2003/03/05] bin/48958 standards The type 'bool' has different sizes for C o [2003/04/21] standards/51209standards [PATCH] add a64l()/l64a/l64a_r functions p [2003/06/05] standards/52972standards /bin/sh arithmetic not POSIX compliant o [2003/07/12] standards/54410standards one-true-awk not POSIX compliant (no exte o [2003/09/15] standards/56906standards Several math(3) functions fail to set err o [2003/12/31] standards/60772standards _Bool and bool should be unsigned o [2004/02/05] standards/62388standards sys/resource.h does not pull in dependenc 10 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [1995/01/11] i386/105 standards Distributed libm (msun) has non-standard o [2000/09/24] bin/21519 standards sys/dir.h should be deprecated some more o [2000/12/05] kern/23304 standards POSIX clock_gettime, clock_getres return o [2001/01/16] bin/24390 standards Replacing old dir-symlinks when using /bi s [2001/06/18] kern/28260 standards UIO_MAXIOV needs to be made public o [2001/11/20] standards/32126standards getopt(3) not Unix-98 conformant s [2002/03/18] standards/36076standards Implementation of POSIX fuser command o [2002/06/13] standards/39256standards [v]snprintf aren't POSIX-conformant for s o [2002/07/09] misc/40378 standards stdlib.h gives needless warnings with -an p [2002/08/12] standards/41576standards POSIX compliance of ln(1) o [2002/10/23] standards/44425standards getcwd() succeeds even if current dir has o [2002/12/09] standards/46119standards Priority problems for SCHED_OTHER using p o [2002/12/23] standards/46504standards Warnings in headers o [2003/06/22] standards/53613standards FreeBSD doesn't define EPROTO o [2003/06/24] bin/53682 standards [PATCH] add fuser(1) utitity o [2003/07/24] standards/54809standards pcvt deficits o [2003/07/24] standards/54833standards more pcvt deficits o [2003/07/25] standards/54839standards pcvt deficits o [2003/07/31] standards/55112standards glob.h, glob_t's gl_pathc should be "size o [2003/09/04] standards/56476standards cd9660 unicode support simple hack o [2003/09/27] standards/57295standards [patch] make does not include cmd line va o [2003/10/12] standards/57911standards fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) o [2003/10/29] standards/58676standards grantpt(3) alters storage used by ptsname o [2003/11/29] standards/59797standards Implement C99's round[f]() math fucntions p [2003/12/26] standards/60597standards FreeBSD's /usr/include lacks of cpio.h s [2004/02/14] standards/62858standards malloc(0) not C99 compliant p [2004/02/21] standards/63173standards Patch to add getopt_long_only(3) to libc o [2004/02/25] standards/63371standards [patch] isblank() not in C99/SUSv3 namesp o [2004/03/12] standards/64173standards C99 requires some macros to be c 29 problems total. From owner-freebsd-standards@FreeBSD.ORG Tue Mar 23 05:34:32 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0B5316A4CE for ; Tue, 23 Mar 2004 05:34:32 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CD8243D39 for ; Tue, 23 Mar 2004 05:34:32 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2NDYVEw017150; Tue, 23 Mar 2004 08:34:31 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040322155901.GA17891@stack.nl> References: <20040322155901.GA17891@stack.nl> Date: Tue, 23 Mar 2004 08:34:30 -0500 To: Jilles Tjoelker , freebsd-standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 13:34:33 -0000 At 4:59 PM +0100 3/22/04, Jilles Tjoelker wrote: >On Sat, Mar 20, 2004, Garance A Drosihn wrote: > >> Adds a `-R ruserlist' option, which is the same as what > > SYSv3 describes for `-u' (we already have a `-u'). > >SUSv3 says -u selects by effective uid and -U selects by real >uid. FreeBSD -U selects by effective uid and -u is something >else totally. Actually, the code I wrote is fine, it's just that I described it wrong... For now I'll add the -R so we have the additional capability, and we can worry about -E vs -U vs -u vs POSIX at a later date. > > [snip] >> Fixes interactions between all these "selector options", > > & our `-x' option (which is not mentioned in SUSv3). > >Hmm, this means the user must add `-x' if `-U', `-s', etc. are >used and he wants to see all matching processes. That's not good >for writing scripts that should work on both Solaris and FreeBSD, >for example. Also, `-U' used to imply `-x' on FreeBSD (it does >not on NetBSD). > >I propose making it so that `-x' is implied when any selector >except `-a' is used. I have done this, and added the `-X' option that I talked about to reverse `-x'. The selector options (except -a and -p) will set a "xkeep_implied" flag. If neither `-X' nor '-x' are given, then we use the "implied" flag. If both are given, then we use whichever one was given last. Thanks for the feedback. New update is in: http://people.freebsd.org/~gad/ps-susv3.diff This update does NOT add the new `-g' option, so it should be true that this does not result in any incompatible change in how `ps' works. I will follow this with a separate (tiny) update to replace the old `-g' with the new one, and a second tiny update to change some of the warnings for `-U' to be fatal errors. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Wed Mar 24 13:48:05 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD13516A4DA; Wed, 24 Mar 2004 13:48:05 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id B66BF43D31; Wed, 24 Mar 2004 13:48:05 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc11) with SMTP id <2004032421480401300132fce>; Wed, 24 Mar 2004 21:48:05 +0000 From: Albert Cahalan To: freebsd-arch@freebsd.org, freebsd-standards@freebsd.org Content-Type: text/plain Organization: Message-Id: <1080165171.2232.910.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 24 Mar 2004 16:52:52 -0500 Content-Transfer-Encoding: 7bit cc: drosih@rpi.edu Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 21:48:06 -0000 Wow, the SUSv3 ps problem is finally being addressed. I hope that you'll be willing to discuss this with the Linux ps author (me) and maybe drag in a few other ps authors or maintainers. This is your chance to put an end to sysadmins everywhere cursing the historical ps differences; don't let NIH stop you. Perhaps there is a better place to discuss this. I'm not even sure my mail will get through to freebsd-arch and freebsd-standards. I'm a Comcast customer. :-/ I think you may be painting yourself into a corner if you commit the proposed changes. Please delay them at the very least. I'd be happy to work with somebody to write a spec for good behavior, kind of like SUSv3 plus BSD minus crufty bits. ------ comments on various proposed changes ------ > Now, after about 30 consecutive "as long as I was there" small > projects, I have an update which: > Changes -p so it accepts a list of process IDs, and -t so > it accepts a list of terminal names (instead of only > allowing a single value). Good. > Adds the -A option of SUSv3 (exactly the same as `-ax') You've added both "A" and "-A", right? That is, you're still not using the presense/absense of a "-" to provide for separate BSD and UNIX switch namespaces. You wouldn't be caving to the Linux world if you did; I swiped the idea from Digital UNIX. (a.k.a. Tru64 or OSF/1) It's also in AIX. > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > (note that this replaced a null `-g' option...) Eh... must you? You're trashing compatibility with SunOS 4. Separate option namespaces solve this problem fairly well, especially if you let an environment variable force the parser into a pure traditional-bsd mode. > Adds a `-R ruserlist' option, which is the same as what > SYSv3 describes for `-u' (we already have a `-u'). > Amazingly, none of solaris, linux, or irix seem to > have any kind of `-R' option. Why should they? The -u option works fine. Linux is a bit special here, in that -u may be used simultaneously with the BSD-style u option: ps u -u root,albert > Adds a `-s sidlist' option, which is not in SUSv3, but > it is in solaris, linux, and irix -- and it's an > option I have personally wished for on occasion... What about the traditional BSD signals format? I know NetBSD broke this... you too? It is valuable when debugging. > Allows the user to specify any of these "selector options" > multiple times, and have it keep adding to that > list instead of replacing values for that list. Good. > Better parsing of options. Better error messages for > invalid values (IMO). I notice that you're jumping through hoops for "ps t" support. Getting rid of the getopt-based parser would greatly help you. > Fixes interactions between all these "selector options", > & our `-x' option (which is not mentioned in SUSv3). > For the selector options, I tried to meet the > description of: "If any are specified, the default > list shall be ignored and ps shall select the > processes represented by the inclusive OR of all > the selection-criteria options." Here you have a big ugly problem. Historical BSD selection acts by lifting filters which are enabled by default. UNIX selection acts by adding processes to a set that will be displayed, except that the default is a special case to avoid an empty display. I've worked hard to get reasonable results out of mixed BSD and UNIX selection, but that isn't so important. You could give an error in that case. There are essentially 4 cases that you have to deal with: 1. the default special case 2. BSD selection 'a' and 'x' disable filters 3. UNIX selection add processes to an empty set 4. BSD + UNIX selection error > Applies all these selection criteria *before* sorting > the list of processes we get from kvm_getprocs(), > and before using the list to compute the sizes of > the output fields. Cute, but memory-intensive and not friendly if your process table ever gets corrupted. It's not so nice on SMP either, since a grep or awk script ("ps ... | awk ...") can't start until ps is done. > Please look it over, try it out, and let me know if these options > seem to work the way you'd expect them to, or if I have messed > anything up. And please please PLEASE -- don't give me any more > ideas of something *else* I could do "as long as I'm there"! Oh. Sorry. > Great. So what should I do here? Add a -E' option for "effective > userid"? In fact, add both -E' and -R', and then we would have > two options that we could MFC into 4.x as well as 5.x (without any > conflict). At some later date (in 6.x?), we would have the option > of changing '-U' to match the standard definition. Amazingly, both > -E' and -R' seem to be unused on the other OS's I have here. If you split the namespace like AIX, Tru64, and Linux do, then you don't need these options. > I am not thrilled with that idea, but at the moment I can't think > of a better one. I *would* like to support matches of both real > and effective users. I guess we could add some other option > which would say "use the POSIX definitions of -u and -U", but that > doesn't exactly thrill me either. Why not? Tru64 uses the CMD_ENV environment variable to handle this. Linux does too, with PS_PERSONALITY taking priority. So, on either OS, you can do: ps -u root -U albert ps u CMD_ENV=sysv ps -u root -U albert CMD_ENV=bsd ps -u ps -u # this is an error on Tru64, and a warning on Linux > Old BSD ps used to exclude process group leaders > unless '-g' or '-x' were given. If you want it, I'll help somebody port the Linux ps. :-) I'll even consider a non-LGPL license if that changes things. Then you can enjoy near-perfect SunOS 4 goodness: PS_PERSONALITY=sunos4 ps -aux PS_PERSONALITY=sunos4 ps -auxg > Well, my follow-up message explained my reasoning for this in more > detail, but your logic seems pretty reasonable too. If I do this, > I'll add a -X option which would "turn off -x", so to speak. There > are times where I don't want to see the extra processes. A -X' > option does not seem to conflict with solaris, aix, or irix. Linux > does have a -X, but it's for "old Linux i386 register format", and I > think we can safely assume we would never implement that, and that > it is also not likely to become a "standard" option... The X format is not really i386-specific. The column headers sure look like it, but the ESP and EIP columns are really just the stack and instruction pointers. They work fine on PowerPC. You're not helping the suffering sysadmins if you add yet another incompatible feature. Portable scripts won't be able to use your proposed X option. From owner-freebsd-standards@FreeBSD.ORG Wed Mar 24 16:43:28 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48B3516A4CE for ; Wed, 24 Mar 2004 16:43:28 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFFA143D31 for ; Wed, 24 Mar 2004 16:43:27 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2P0hPHB003973; Wed, 24 Mar 2004 19:43:25 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080165171.2232.910.camel@cube> References: <1080165171.2232.910.camel@cube> Date: Wed, 24 Mar 2004 19:43:23 -0500 To: Albert Cahalan , freebsd-standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 00:43:28 -0000 At 4:52 PM -0500 3/24/04, Albert Cahalan wrote: >Wow, the SUSv3 ps problem is finally being addressed. Eek! Someone taking me way too seriously! :-) >I hope that you'll be willing to discuss this with the Linux >ps author (me) and maybe drag in a few other ps authors or >maintainers. I very much like the goal, but (as usual) I'm a bit pressed for time. As I said in my original message, all I really *needed* to do was to get rid of the one case where `ps' started printing an error message on freebsd-current, where it had not been printed on freebsd-stable (4.x). >Perhaps there is a better place to discuss this. I'm not even >sure my mail will get through to freebsd-arch and >freebsd-standards. I have trimmed freebsd-arch. We don't need to discuss it on two freebsd mailing lists. >I think you may be painting yourself into a corner if you commit >the proposed changes. Please delay them at the very least. I'd >be happy to work with somebody to write a spec for good behavior, >kind of like SUSv3 plus BSD minus crufty bits. We (FreeBSD) are just about to start calling our 5.x branch the "stable" branch. As such, I am not comfortable with removing any of the "crufty bits". I don't want to paint `ps' further into a corner than it already is, but I simply do not have the time right now to address all `ps' vs SUSv3 issues. No matter how nice it would be -- ENOTIME. >------ comments on various proposed changes ------ > > Adds the -A option of SUSv3 (exactly the same as `-ax') > >You've added both "A" and "-A", right? That is, you're still >not using the presense/absense of a "-" to provide for separate >BSD and UNIX switch namespaces. Apparently I have. 'ps A' and 'ps -A' seem to do the same thing for me. > > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. >> (note that this replaced a null `-g' option...) > >Eh... must you? You're trashing compatibility with SunOS 4. >Separate option namespaces solve this problem fairly well, >especially if you let an environment variable force the >parser into a pure traditional-bsd mode. My initial commit (which I still hope to do this weekend) will leave `-g' as it is (ie, as a null option). But my intention is to add the SUSv3-ish version of `-g' fairly soon. Since none of the BSD's have ever documented this option, I don't feel as bad about stealing it to line up with SUSv3. Of the FreeBSD users who responded, the feeling has been "I'd rather have this SUSv3 option added than stick with the null-option". > > Adds a `-R ruserlist' option, which is the same as what >> SYSv3 describes for `-u' (we already have a `-u'). >> Amazingly, none of solaris, linux, or irix seem to >> have any kind of `-R' option. > >Why should they? The -u option works fine. I meant that as: "No one uses -R for something else, so I can use it for this". Given an infinite number of possible options, and multiple programmers working on separate versions of `ps', it's amazing that there's any single-letters left over! :-) Note that we already have a `-u' option... I notice that you're talking as if '-option' and 'option' are different namespaces. This is not true on FreeBSD. If we have a '-u', then we also have a 'u' which means the exact same thing. > > Adds a `-s sidlist' option, which is not in SUSv3, but >> it is in solaris, linux, and irix -- and it's an >> option I have personally wished for on occasion... > >What about the traditional BSD signals format? I know NetBSD >broke this... you too? It is valuable when debugging. I don't know what you are referring to. FreeBSD's `ps' did not have any `-s' option, so adding this option does not conflict with anything we presently have... Hrm. I see that NetBSD does have some `-s' option, although at least OpenBSD does not. I forgot to check for that before. I am still inclined to add the sidlist-s option to FreeBSD's `ps'. > > Better parsing of options. Better error messages for >> invalid values (IMO). > >I notice that you're jumping through hoops for "ps t" support. >Getting rid of the getopt-based parser would greatly help you. ENOTIME. `ps' is not high on my own personal priority list. (given that my real-world job has nothing to do with FreeBSD, and that job is about to get very busy again). (I don't get your example of `ps -t' here. Iirc that processing is pretty straightforward. But some of the other option-handling does do a bit of hoop-jumping, so I know what you're getting at) > > Applies all these selection criteria *before* sorting >> the list of processes we get from kvm_getprocs(), >> and before using the list to compute the sizes of >> the output fields. > >Cute, but memory-intensive and not friendly if your process >table ever gets corrupted. It's not so nice on SMP either, >since a grep or awk script ("ps ... | awk ...") can't start >until ps is done. ??? How can it be memory intensive if I *avoid* sorting the entire list of processes? I already *have* the entire list, it's just a question of how many of the elements I sort. I can't possibly be doing more work or using more memory than the previous code did. Well, at least not for this part... > > I am not thrilled with that idea, but at the moment I can't > > think of a better one. I *would* like to support matches of > > both real and effective users. I guess we could add some > > other option which would say "use the POSIX definitions of > > -u and -U", but that doesn't exactly thrill me either. > >Why not? Tru64 uses the CMD_ENV environment variable to >handle this. Linux does too, with PS_PERSONALITY taking >priority. So, on either OS, you can do: I don't like keying a command's option-parsing behavior off of environment variables. I can be talked into it if it would be following some precedent in other OS's, but my initial-reaction to this tactic (for any command) is to avoid it. Please note that this isn't some multi-month project that I've been working on, I have been looking at this for less than a week, and very little of that week. I just thought I'd do some of the "easy stuff" that would get our `ps' a little closer to SUSv3. So, given a little time you might be able talk me into using environment vars to clean this up, but at the moment: ENOTIME... We could perhaps tackle this for 6.x-branch (coming soon!), and then think about moving the result to `ps' in 5.x-stable if that result is reasonably backwards-compatible. > > .... If I do this, I'll add a -X option which would "turn off > > -x", so to speak. There are times where I don't want to see > > the extra processes. A -X' option does not seem to conflict > > with solaris, aix, or irix. Linux does have a -X, but it's > > for "old Linux i386 register format", and I think we can safely > > assume we would never implement that, and that it is also not > > likely to become a "standard" option... > >The X format is not really i386-specific. The column headers >sure look like it, but the ESP and EIP columns are really just >the stack and instruction pointers. They work fine on PowerPC. I wasn't looking at "i386", I was looking at "old ... format", which is how it is described in the redhat 7.3 man page. I assumed that meant "This is only provided for some old things, we don't expect people to use it for new stuff". >You're not helping the suffering sysadmins if you add yet >another incompatible feature. Portable scripts won't be able >to use your proposed X option. If all the work I'm doing here does not *help* any sysadmins, I would be mighty surprised. Linux is the only OS that I noticed using -X. If you're happily handling multiple name-spaces for options, then I'm not sure why -X is going to be so much weirder than our already-existing -x. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Wed Mar 24 17:20:12 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D7E116A4CE for ; Wed, 24 Mar 2004 17:20:12 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC4C243D3F for ; Wed, 24 Mar 2004 17:20:11 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2P1KBLP030540; Wed, 24 Mar 2004 20:20:11 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: <1080165171.2232.910.camel@cube> Date: Wed, 24 Mar 2004 20:20:09 -0500 To: Albert Cahalan , freebsd-standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 01:20:12 -0000 At 7:43 PM -0500 3/24/04, Garance A Drosihn wrote: >At 4:52 PM -0500 3/24/04, Albert Cahalan wrote: > >> > I am not thrilled with that idea, but at the moment I can't >> > think of a better one. I *would* like to support matches of >> > both real and effective users. I guess we could add some >> > other option which would say "use the POSIX definitions of >> > -u and -U", but that doesn't exactly thrill me either. >> >>Why not? Tru64 uses the CMD_ENV environment variable to >>handle this. Linux does too, with PS_PERSONALITY taking >>priority. So, on either OS, you can do: > >I don't like keying a command's option-parsing behavior off of >environment variables. I can be talked into it if it would be >following some precedent in other OS's, but my initial-reaction >to this tactic (for any command) is to avoid it. Please note that >this isn't some multi-month project that I've been working on, I >have been looking at this for less than a week, and very little >of that week. I just thought I'd do some of the "easy stuff" >that would get our `ps' a little closer to SUSv3. > >So, given a little time you might be able talk me into using >environment vars to clean this up, but at the moment: ENOTIME... I should mention that I have been thinking of MAYBE creating some new command, say `psx', which would be much more SUSv3 compatible. It would be the same source code as `ps', and the behavior would key off of the name of the executable. Actually, maybe two new commands, `psbsd' and `psx'. In 5.x-stable we would have `ps' be exactly the same as `psbsd', and in 6.x-current we could have `ps' be exactly the same as `psx'. That way, scripts which HAD to work on both systems could pick the executable that they wanted. I haven't discussed that with anyone else yet, though. It's just something that came to mind when I was thinking about all these conflicting-options over the weekend. For all I know, everyone here would hate the idea... Give me another week to think about it, and I might even hate the idea! -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Wed Mar 24 18:50:03 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F262916A4CE for ; Wed, 24 Mar 2004 18:50:02 -0800 (PST) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C44C43D31 for ; Wed, 24 Mar 2004 18:50:02 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc13) with SMTP id <2004032502495401600qqu6je>; Thu, 25 Mar 2004 02:50:01 +0000 From: Albert Cahalan To: Garance A Drosihn In-Reply-To: References: <1080165171.2232.910.camel@cube> Content-Type: text/plain Organization: Message-Id: <1080183274.2233.984.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 24 Mar 2004 21:54:35 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: Albert Cahalan Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 02:50:03 -0000 On Wed, 2004-03-24 at 19:43, Garance A Drosihn wrote: > At 4:52 PM -0500 3/24/04, Albert Cahalan wrote: > >Wow, the SUSv3 ps problem is finally being addressed. > > Eek! Someone taking me way too seriously! :-) > > >I hope that you'll be willing to discuss this with the Linux > >ps author (me) and maybe drag in a few other ps authors or > >maintainers. > > I very much like the goal, but (as usual) I'm a bit pressed for > time. As I said in my original message, all I really *needed* to I've been thinking about getting at least the Tru64 and AIX sort of behavior into the next UNIX standard. I showed up a bit too late for the last revision. > >Perhaps there is a better place to discuss this. I'm not even > >sure my mail will get through to freebsd-arch and > >freebsd-standards. > > I have trimmed freebsd-arch. We don't need to discuss it on > two freebsd mailing lists. I'll trust that you know better than I do, but "arch" sure sounds like an appropriate place. > >I think you may be painting yourself into a corner if you commit > >the proposed changes. Please delay them at the very least. I'd > >be happy to work with somebody to write a spec for good behavior, > >kind of like SUSv3 plus BSD minus crufty bits. > > We (FreeBSD) are just about to start calling our 5.x branch the > "stable" branch. As such, I am not comfortable with removing > any of the "crufty bits". That got mis-parsed. SUSv3 has some crufty bits that are often violated. You can keep your own crufty bits. > >------ comments on various proposed changes ------ > > > Adds the -A option of SUSv3 (exactly the same as `-ax') > > > >You've added both "A" and "-A", right? That is, you're still > >not using the presense/absense of a "-" to provide for separate > >BSD and UNIX switch namespaces. > > Apparently I have. 'ps A' and 'ps -A' seem to do the same > thing for me. BTW, no real UNIX user ever uses -A. The -e option is used. The -A is a bit of crud some POSIX committee dreamed up. > > > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > >> (note that this replaced a null `-g' option...) > > > >Eh... must you? You're trashing compatibility with SunOS 4. > >Separate option namespaces solve this problem fairly well, > >especially if you let an environment variable force the > >parser into a pure traditional-bsd mode. > > My initial commit (which I still hope to do this weekend) will > leave `-g' as it is (ie, as a null option). But my intention > is to add the SUSv3-ish version of `-g' fairly soon. Since > none of the BSD's have ever documented this option, I don't > feel as bad about stealing it to line up with SUSv3. Of the > FreeBSD users who responded, the feeling has been "I'd rather > have this SUSv3 option added than stick with the null-option". This is not a 2-way choice. 1. null-option for a bit of SunOS 4 script compatibility 2. SUSv3 "-g", plus accepting "g" alone as an alias 3. SUSv3 "-g", plus "g" for SunOS 4 script compatibility If you choose #2 now, you'll have forever lost compatibility with SunOS 4. (and thus with Linux, though "g" isn't a requirement for Linux scripts) It would be quite a bit of trouble to switch from behavior #2 to #3 after people have gotten used to behavior #2. > > > Adds a `-R ruserlist' option, which is the same as what > >> SYSv3 describes for `-u' (we already have a `-u'). > >> Amazingly, none of solaris, linux, or irix seem to > >> have any kind of `-R' option. > > > >Why should they? The -u option works fine. > > I meant that as: "No one uses -R for something else, so I can > use it for this". Given an infinite number of possible options, > and multiple programmers working on separate versions of `ps', > it's amazing that there's any single-letters left over! :-) Oh. In that case, "-R" is used to select by PRM groups. It's an HP/UX feature that Linux is likely to adopt. Plain "R" (no hyphen) will remain available of course. > Note that we already have a `-u' option... I notice that you're > talking as if '-option' and 'option' are different namespaces. > This is not true on FreeBSD. If we have a '-u', then we also > have a 'u' which means the exact same thing. Yes, I know. This is why "ps -ef" won't work for you. AIX, Tru64, and Linux all split the namespaces to solve this problem. Join the crowd! :-) With a trivial shell script in /usr/local/bin, Solaris works this way too. Everybody has the script, right? #!/bin/sh case "$1" in -*) exec /bin/ps "$@" ;; *) exec /usr/ucb/ps "$@" ;; esac > > > Adds a `-s sidlist' option, which is not in SUSv3, but > >> it is in solaris, linux, and irix -- and it's an > >> option I have personally wished for on occasion... > > > >What about the traditional BSD signals format? I know NetBSD > >broke this... you too? It is valuable when debugging. > > I don't know what you are referring to. FreeBSD's `ps' did not > have any `-s' option, so adding this option does not conflict > with anything we presently have... > > Hrm. I see that NetBSD does have some `-s' option, although at > least OpenBSD does not. I forgot to check for that before. I > am still inclined to add the sidlist-s option to FreeBSD's `ps'. Wow. Real BSD is dead. The "s" option prints signal info. At least Tru64 and AIX still support this. NetBSD had it until they added an extra 96 signals. With a bit of whitespace deleted, my implementation gives: UID PID PENDING BLOCKED IGNORED CAUGHT STAT TTY TIME COMMAND 123 1866 00000000 00010000 <00380004 00010002 S tty1 0:00 /bin/sh 123 2042 00000000 00000000 <00000000 00003207 S tty1 0:00 xinit / 123 2046 00000000 00000000 <00000000 000014c0 S tty1 0:00 x-sessi 123 9149 00000000 00000000 <00384004 4b813efb S pts/1 0:00 bash Wide output gives all 64 signals, instead of the "<" or " ". > > > Applies all these selection criteria *before* sorting > >> the list of processes we get from kvm_getprocs(), > >> and before using the list to compute the sizes of > >> the output fields. > > > >Cute, but memory-intensive and not friendly if your process > >table ever gets corrupted. It's not so nice on SMP either, > >since a grep or awk script ("ps ... | awk ...") can't start > >until ps is done. > > ??? How can it be memory intensive if I *avoid* sorting the > entire list of processes? I already *have* the entire list, > it's just a question of how many of the elements I sort. I > can't possibly be doing more work or using more memory than > the previous code did. Well, at least not for this part... If you're already reading the whole thing before printing any output, then sure. GNU Hurd does this too. It makes for pretty output, but it doesn't scale. > > > I am not thrilled with that idea, but at the moment I can't > > > think of a better one. I *would* like to support matches of > > > both real and effective users. I guess we could add some > > > other option which would say "use the POSIX definitions of > > > -u and -U", but that doesn't exactly thrill me either. > > > >Why not? Tru64 uses the CMD_ENV environment variable to > >handle this. Linux does too, with PS_PERSONALITY taking > >priority. So, on either OS, you can do: > > I don't like keying a command's option-parsing behavior off of > environment variables. I can be talked into it if it would be > following some precedent in other OS's, but my initial-reaction > to this tactic (for any command) is to avoid it. Please note that > this isn't some multi-month project that I've been working on, I > have been looking at this for less than a week, and very little > of that week. I just thought I'd do some of the "easy stuff" > that would get our `ps' a little closer to SUSv3. > > So, given a little time you might be able talk me into using > environment vars to clean this up, but at the moment: ENOTIME... > > We could perhaps tackle this for 6.x-branch (coming soon!), and > then think about moving the result to `ps' in 5.x-stable if that > result is reasonably backwards-compatible. You could always do this for the die-hards: #!/bin/sh # This is the /usr/ucb/ps script. CMD_ENV=bsd exec /bin/ps "$@" > > > .... If I do this, I'll add a -X option which would "turn off > > > -x", so to speak. There are times where I don't want to see > > > the extra processes. A -X' option does not seem to conflict > > > with solaris, aix, or irix. Linux does have a -X, but it's > > > for "old Linux i386 register format", and I think we can safely > > > assume we would never implement that, and that it is also not > > > likely to become a "standard" option... > > > >The X format is not really i386-specific. The column headers > >sure look like it, but the ESP and EIP columns are really just > >the stack and instruction pointers. They work fine on PowerPC. > > I wasn't looking at "i386", I was looking at "old ... format", > which is how it is described in the redhat 7.3 man page. I > assumed that meant "This is only provided for some old things, > we don't expect people to use it for new stuff". > > >You're not helping the suffering sysadmins if you add yet > >another incompatible feature. Portable scripts won't be able > >to use your proposed X option. > > If all the work I'm doing here does not *help* any sysadmins, I > would be mighty surprised. Linux is the only OS that I noticed > using -X. If you're happily handling multiple name-spaces for > options, then I'm not sure why -X is going to be so much weirder > than our already-existing -x. I can't support your proposed "ps X" (or "ps -X") in the default personality for my ps. Any "portable" (free OS for now) script using this would need to set CMD_ENV=bsd or PS_PERSONALITY=bsd. Got anything against long options? I use these: --Group select by real group name or ID --User select by real user name or ID --group select by effective group name or ID --user select by effective user name or ID Anyway, the "-X" or "X" idea is what??? You want to force enable the must-have-tty filter that "-x" or a SUSv3 option would disable? This is of very limited use I think. What would happen with both X and x at the same time? From owner-freebsd-standards@FreeBSD.ORG Wed Mar 24 21:45:17 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1961316A4CF for ; Wed, 24 Mar 2004 21:45:17 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE4DE43D1D for ; Wed, 24 Mar 2004 21:45:16 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2P5jFHB017093; Thu, 25 Mar 2004 00:45:15 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080183274.2233.984.camel@cube> References: <1080165171.2232.910.camel@cube> <1080183274.2233.984.camel@cube> Date: Thu, 25 Mar 2004 00:45:14 -0500 To: Albert Cahalan From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 05:45:17 -0000 At 9:54 PM -0500 3/24/04, Albert Cahalan wrote: >On Wed, 2004-03-24, Garance A Drosihn wrote: > >> >You've added both "A" and "-A", right? That is, you're still >> >not using the presense/absense of a "-" to provide for separate >> >BSD and UNIX switch namespaces. >> >> Apparently I have. 'ps A' and 'ps -A' seem to do the same >> thing for me. > >BTW, no real UNIX user ever uses -A. The -e option is used. >The -A is a bit of crud some POSIX committee dreamed up. We already have a -e, so I can't just add that. It shouldn't hurt us to add -A, and it'll prevent me from adding something else as -A at a later date... :-) > > ... But my intention is to add the SUSv3-ish version of `-g' > > fairly soon. ... Of the FreeBSD users who responded, the > > feeling has been "I'd rather have this SUSv3 option added > > than stick with the null-option". > >This is not a 2-way choice. > >1. null-option for a bit of SunOS 4 script compatibility >2. SUSv3 "-g", plus accepting "g" alone as an alias >3. SUSv3 "-g", plus "g" for SunOS 4 script compatibility > >If you choose #2 now, you'll have forever lost compatibility >with SunOS 4. I'll see what other FreeBSD'ers think about this. I have no SunOS 4 machines to worry about, and I have never used "g" on Linux. I'd rather make a clean break and just do what the standard says. > > Note that we already have a `-u' option... I notice that > > you're talking as if '-option' and 'option' are different > > namespaces. This is not true on FreeBSD. If we have a > > '-u', then we also have a 'u' which means the exact same > > thing. > >Yes, I know. This is why "ps -ef" won't work for you. >AIX, Tru64, and Linux all split the namespaces to >solve this problem. Join the crowd! :-) Again. This is a side-project I'm doing. I can't afford to devote a lot of time to `ps'. If I try to split the namespace, then the task of merely rewriting the man page will take more time than I intend to spend on this. ENOTIME. (not right now, at least). I might hold off on `-g' for awhile to see if I find some time to consider a namespace split. I'm not too optimistic though. Note that whatever the historical (BSD) background might be, our man page actually describes all options as `-x', and not 'x'. > > >> Adds a `-s sidlist' option, which is not in SUSv3, > > >> but it is in solaris, linux, and irix ... > > > >> >What about the traditional BSD signals format? I know NetBSD >> >broke this... you too? It is valuable when debugging. >> >> I don't know what you are referring to. FreeBSD's `ps' did not >> have any `-s' option, so adding this option does not conflict >> with anything we presently have... >> >> Hrm. I see that NetBSD does have some `-s' option, although at >> least OpenBSD does not. I forgot to check for that before. I >> am still inclined to add the sidlist-s option to FreeBSD's `ps'. > >Wow. Real BSD is dead. The "s" option prints signal info. I'll add the `-s' option for sidlist. If we later split the namespace, we can use a `s' option for signal info, if that is appropriate. > > So, given a little time you might be able talk me into using >> environment vars to clean this up, but at the moment: ENOTIME... >> >> We could perhaps tackle this for 6.x-branch (coming soon!), and >> then think about moving the result to `ps' in 5.x-stable if that >> result is reasonably backwards-compatible. > >You could always do this for the die-hards: ENOTIME means ENOTIME. It does not mean "tell me extra scripts I could write on top of extra coding I could do". >Got anything against long options? I use these: > >--Group select by real group name or ID >--User select by real user name or ID >--group select by effective group name or ID >--user select by effective user name or ID BSD commands rarely (almost never?) have long options. I personally don't mind them much, but, well, ENOTIME. >Anyway, the "-X" or "X" idea is what??? You want to force >enable the must-have-tty filter that "-x" or a SUSv3 option >would disable? This is of very limited use I think. What >would happen with both X and x at the same time? Like most "turn on" vs "turn off" options: the last one wins. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 06:51:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFA6916A4CE; Thu, 25 Mar 2004 06:51:25 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA16943D49; Thu, 25 Mar 2004 06:51:25 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 632AD5485D; Thu, 25 Mar 2004 08:51:25 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 03E636D455; Thu, 25 Mar 2004 08:51:24 -0600 (CST) Date: Thu, 25 Mar 2004 08:51:24 -0600 From: "Jacques A. Vidrine" To: Garance A Drosihn Message-ID: <20040325145124.GB61830@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Garance A Drosihn , Jilles Tjoelker , arch@freebsd.org, freebsd-standards@freebsd.org References: <20040322155901.GA17891@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: arch@freebsd.org cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 14:51:26 -0000 On Mon, Mar 22, 2004 at 01:18:22PM -0500, Garance A Drosihn wrote: > Great. So what should I do here? I dunno. Add a completely POSIX compliant ps command into /usr/posix ? Or replace /usr/bin/ps with a completely POSIX compliant ps and move our traditional one to /usr/ucb? :-) Seriously, we should give some hard thought into how to provide/migrate to a POSIX compatible utilities environment. It's been discussed on the lists before, but I still believe providing POSIX compatible versions of utilities on a separate path is the only clean way to make this happen. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 07:35:50 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7FCF16A4CF for ; Thu, 25 Mar 2004 07:35:50 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 520F243D4C for ; Thu, 25 Mar 2004 07:35:50 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc12) with SMTP id <20040325153548012006ke18e>; Thu, 25 Mar 2004 15:35:49 +0000 From: Albert Cahalan To: Garance A Drosihn In-Reply-To: References: <1080165171.2232.910.camel@cube> <1080183274.2233.984.camel@cube> Content-Type: text/plain Organization: Message-Id: <1080229235.2233.1028.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 25 Mar 2004 10:40:36 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: Albert Cahalan Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 15:35:50 -0000 On Thu, 2004-03-25 at 00:45, Garance A Drosihn wrote: > At 9:54 PM -0500 3/24/04, Albert Cahalan wrote: > >On Wed, 2004-03-24, Garance A Drosihn wrote: > > > >> >You've added both "A" and "-A", right? That is, you're still > >> >not using the presense/absense of a "-" to provide for separate > >> >BSD and UNIX switch namespaces. > >> > >> Apparently I have. 'ps A' and 'ps -A' seem to do the same > >> thing for me. > > > >BTW, no real UNIX user ever uses -A. The -e option is used. > >The -A is a bit of crud some POSIX committee dreamed up. > > We already have a -e, so I can't just add that. > > It shouldn't hurt us to add -A, and it'll prevent me from > adding something else as -A at a later date... :-) It does hurt you, by making for greater pain or less gain when you get around to splitting the namespaces. You'll either drop the plain "A", or you'll keep it in spite of having other options that do the same thing. You're running out of letters that most people are able to type. How about leaving it undocumented on purpose? That would let scripts using "-A" work fine, while not encouraging use. > > > ... But my intention is to add the SUSv3-ish version of `-g' > > > fairly soon. ... Of the FreeBSD users who responded, the > > > feeling has been "I'd rather have this SUSv3 option added > > > than stick with the null-option". > > > >This is not a 2-way choice. > > > >1. null-option for a bit of SunOS 4 script compatibility > >2. SUSv3 "-g", plus accepting "g" alone as an alias > >3. SUSv3 "-g", plus "g" for SunOS 4 script compatibility > > > >If you choose #2 now, you'll have forever lost compatibility > >with SunOS 4. > > I'll see what other FreeBSD'ers think about this. I have > no SunOS 4 machines to worry about, and I have never used > "g" on Linux. I'd rather make a clean break and just do > what the standard says. Problem is, you're not just adding "-g". You're adding "g". > > > Note that we already have a `-u' option... I notice that > > > you're talking as if '-option' and 'option' are different > > > namespaces. This is not true on FreeBSD. If we have a > > > '-u', then we also have a 'u' which means the exact same > > > thing. > > > >Yes, I know. This is why "ps -ef" won't work for you. > >AIX, Tru64, and Linux all split the namespaces to > >solve this problem. Join the crowd! :-) > > Again. This is a side-project I'm doing. I can't afford to > devote a lot of time to `ps'. If I try to split the namespace, > then the task of merely rewriting the man page will take more > time than I intend to spend on this. ENOTIME. (not right now, > at least). Suppose that CMD_ENV=bsd were the default for FreeBSD 5. Then it would not be a terrible sin to leave the changes undocumented for now. I'll give you a hand with the parser if you have a recent FreeBSD system you can show me around. The ps command has been annoying cross-platform sysadmins for far too long. Once you split the namespace, it gets easier to get Sun to have their /bin/ps exec /usr/ucb/ps on a syntax error. Then we'd be well on our way to forgetting the incompatibility. > >Wow. Real BSD is dead. The "s" option prints signal info. > > I'll add the `-s' option for sidlist. If we later split the > namespace, we can use a `s' option for signal info, if that is > appropriate. You'd be adding something ("ps s 12345") and then removing it in favor of something else. That doesn't go over well. Temporary hacks usually stand until the end of time. From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 09:58:00 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B31D616A4CE for ; Thu, 25 Mar 2004 09:58:00 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 670BF43D39 for ; Thu, 25 Mar 2004 09:58:00 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PHvwEw010463; Thu, 25 Mar 2004 12:57:59 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080229235.2233.1028.camel@cube> References: <1080165171.2232.910.camel@cube> <1080183274.2233.984.camel@cube> <1080229235.2233.1028.camel@cube> Date: Thu, 25 Mar 2004 12:57:57 -0500 To: Albert Cahalan From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 17:58:00 -0000 At 10:40 AM -0500 3/25/04, Albert Cahalan wrote: >On Thu, 2004-03-25 at 00:45, Garance A Drosihn wrote: > > >> It shouldn't hurt us to add -A, and it'll prevent me from > > adding something else as -A at a later date... :-) > >How about leaving it undocumented on purpose? That would >let scripts using "-A" work fine, while not encouraging use. That certainly seems reasonable. That's basically what we did with `g'. > > I'll see what other FreeBSD'ers think about this. I have >> no SunOS 4 machines to worry about, and I have never used >> "g" on Linux. I'd rather make a clean break and just do >> what the standard says. > >Problem is, you're not just adding "-g". You're adding "g". I understand your position on that part. The main difference we have is that you have burned into your brain is that there *is* a separate namespace. It already exists for you. It does not for me -- and I've been using BSD systems for about nine years now. I admit that I have `ps axu' and `ps axuww' burned into my brain, but for all other `ps' commands that I type, I *am* in fact using the `-' on the options. I even do that for `ps -u'. All the scripts I write *do* include the `-'. Why? Because that is what the man page describes. We DO NOT HAVE two namespaces. Any change to make two incompatible namespaces *is* going to be an incompatible change for some of our users -- including me personally... > > Again. This is a side-project I'm doing. I can't afford > > to devote a lot of time to `ps'. If I try to split the > > namespace, then the task of merely rewriting the man page > > will take more time than I intend to spend on this. > > ENOTIME. (not right now, at least). > >I'll give you a hand with the parser if you have a recent >FreeBSD system you can show me around. The ps command has >been annoying cross-platform sysadmins for far too long. I do appreciate this, but it does not give me any more hours in the day. The incompatibilities of `ps' have annoyed me too, that's why I'm staying up a few extra hours per night to make some progress on it. I can nip away at it over time, but I can not solve all of the `ps' issues this week. I just can't. Period. No matter how many times you reword the extra work you would like me to do, it is still EXTRA work. ENOTIME. And part of the work that I am trying to avoid is just trying to decide what the best thing to do would be. In fact, I suspect that part will be more time-consuming than the coding. That IS work, and it IS time, and I do NOT have the time. Please understand that I agree with many of your goals, and I would like to see a better solution done. And I am mulling over what you've been saying to see if there is some minimum- work way that I can leave things in better shape. However, I have hundreds of projects "I would like to" get done, and this is not even a high priority on my own person list of projects. I am *not* trying to solve the BSD vs SUSv3 problem. I am just trying to give FreeBSD users a few more (standard) options. > > >Wow. Real BSD is dead. The "s" option prints signal info. >> >> I'll add the `-s' option for sidlist. If we later split the >> namespace, we can use a `s' option for signal info, if that is >> appropriate. > >You'd be adding something ("ps s 12345") and then removing >it in favor of something else. That doesn't go over well. >Temporary hacks usually stand until the end of time. According to our man page, I'll be adding `-s'. I understand the concern you're expressing, but that exact same problem is going to happen for other options if we split the namespace. Adding `-s' (which WILL be documented as `-s' and not as 's'), does not increase that problem. (IMO) -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 11:17:48 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19AB316A4CE; Thu, 25 Mar 2004 11:17:48 -0800 (PST) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id E60EC43D53; Thu, 25 Mar 2004 11:17:46 -0800 (PST) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:2e0:81ff:fe22:51d8]) by mailhost.stack.nl (Postfix) with ESMTP id 40633059#C68A11F003; Thu, 25 Mar 2004 20:17:45 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id A7D111CC2E; Thu, 25 Mar 2004 20:17:45 +0100 (CET) Date: Thu, 25 Mar 2004 20:17:45 +0100 From: Jilles Tjoelker To: Albert Cahalan Message-ID: <20040325191745.GB71731@stack.nl> References: <1080165171.2232.910.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1080165171.2232.910.camel@cube> X-Operating-System: FreeBSD 5.2.1-RELEASE-p1 i386 User-Agent: Mutt/1.5.6i cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 19:17:48 -0000 On Wed, Mar 24, 2004 at 04:52:52PM -0500, Albert Cahalan wrote: > Wow, the SUSv3 ps problem is finally being addressed. I hope that > you'll be willing to discuss this with the Linux ps author (me) > and maybe drag in a few other ps authors or maintainers. This is > your chance to put an end to sysadmins everywhere cursing the > historical ps differences; don't let NIH stop you. > Perhaps there is a better place to discuss this. I'm not even > sure my mail will get through to freebsd-arch and freebsd-standards. > I'm a Comcast customer. :-/ > I think you may be painting yourself into a corner if you commit > the proposed changes. Please delay them at the very least. I'd > be happy to work with somebody to write a spec for good behavior, > kind of like SUSv3 plus BSD minus crufty bits. I think that has been a historical mistake in the POSIX standardization. tar/cpio were not standardized, instead a new utility "pax" was invented. This should have been done with ps too, as the BSD and System V versions are thoroughly incompatible. Instead, they made some half-hearted attempt at making up some compatible subset. This may be the source of the little-used '-A' option (equivalent to '-e' which is used much more often). > ------ comments on various proposed changes ------ > > > Now, after about 30 consecutive "as long as I was there" small > > projects, I have an update which: > > Changes -p so it accepts a list of process IDs, and -t so > > it accepts a list of terminal names (instead of only > > allowing a single value). > > Good. > > > Adds the -A option of SUSv3 (exactly the same as `-ax') > > You've added both "A" and "-A", right? That is, you're still > not using the presense/absense of a "-" to provide for separate > BSD and UNIX switch namespaces. You wouldn't be caving to the > Linux world if you did; I swiped the idea from Digital UNIX. > (a.k.a. Tru64 or OSF/1) It's also in AIX. I think this is ugly. Also, scripts and users on BSD have started to use a hyphen on BSD-style options, e.g. ps -ux. It may be the least bad way out, though. > > Adds a `-s sidlist' option, which is not in SUSv3, but > > it is in solaris, linux, and irix -- and it's an > > option I have personally wished for on occasion... > What about the traditional BSD signals format? I know NetBSD > broke this... you too? It is valuable when debugging. -O sig,sigmask,sigignore,sigcatch does about that, but requires more typing. The hexadecimal numbers are still annoying. > > Allows the user to specify any of these "selector options" > > multiple times, and have it keep adding to that > > list instead of replacing values for that list. > Good. > > Better parsing of options. Better error messages for > > invalid values (IMO). > I notice that you're jumping through hoops for "ps t" support. > Getting rid of the getopt-based parser would greatly help you. Hmm, I rather like a getopt-based parser for the complicated stuff. However, when the first argument doesn't start with a hyphen, FreeBSD ps does weird things and I have at least one PR on file about that ('ps tpt'). > > I am not thrilled with that idea, but at the moment I can't think > > of a better one. I *would* like to support matches of both real > > and effective users. I guess we could add some other option > > which would say "use the POSIX definitions of -u and -U", but that > > doesn't exactly thrill me either. > Why not? Tru64 uses the CMD_ENV environment variable to > handle this. Linux does too, with PS_PERSONALITY taking > priority. So, on either OS, you can do: > ps -u root -U albert > ps u > CMD_ENV=sysv ps -u root -U albert > CMD_ENV=bsd ps -u > ps -u # this is an error on Tru64, and a warning on Linux It has been discussed on freebsd-standards or -arch. Users may set CMD_ENV=sysv if they want to use System V style options, but scripts will not expect that. This requires all scripts using ps to be changed. Separate paths or names for the two seem like a better way. It seems best that it's one binary that changes behaviour depending on argv[0], but that makes it hard to call both of them by the name "ps". > If you want it, I'll help somebody port the Linux ps. :-) > I'll even consider a non-LGPL license if that changes things. > Then you can enjoy near-perfect SunOS 4 goodness: > PS_PERSONALITY=sunos4 ps -aux > PS_PERSONALITY=sunos4 ps -auxg I use almost all options of FreeBSD 4.x ps now and then, with exception of the obscure '-C' option and the sorting options. I'm not especially fond of Linux ps. Some of my annoyances are: * It's over-complicated, supports options from many Unix variants. This may be unavoidable in the end, though. * 'ps axO user' doesn't show full argv ('ps ax' does) * Doesn't have 'I', 'D', 's', '+' status letters * 'sl' keyword doesn't work Of course, some of these annoyances are due to the Linux kernel and not due to procps itself. I don't find Linux ps as annoying as SysV ps that cannot show me all processes running under my uid without me mentioning my uid on the command line, and truncate long argv pretty quickly. Also, in SUSv3 ps (with XSI extensions) there's no -o equivalent for the default output, -f and -l. -- Jilles Tjoelker From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 12:35:28 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6584116A4CE; Thu, 25 Mar 2004 12:35:28 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F33C43D1D; Thu, 25 Mar 2004 12:35:28 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc13) with SMTP id <200403252035210150082h12e>; Thu, 25 Mar 2004 20:35:27 +0000 From: Albert Cahalan To: Jilles Tjoelker In-Reply-To: <20040325191745.GB71731@stack.nl> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> Content-Type: text/plain Organization: Message-Id: <1080247208.2232.1095.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 25 Mar 2004 15:40:08 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 20:35:28 -0000 On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > On Wed, Mar 24, 2004 at 04:52:52PM -0500, Albert Cahalan wrote: > > Wow, the SUSv3 ps problem is finally being addressed. I hope that > > you'll be willing to discuss this with the Linux ps author (me) > > and maybe drag in a few other ps authors or maintainers. This is > > your chance to put an end to sysadmins everywhere cursing the > > historical ps differences; don't let NIH stop you. ... > I think that has been a historical mistake in the POSIX standardization. > tar/cpio were not standardized, instead a new utility "pax" was > invented. This should have been done with ps too, as the BSD and System > V versions are thoroughly incompatible. Instead, they made some > half-hearted attempt at making up some compatible subset. This may be > the source of the little-used '-A' option (equivalent to '-e' which is > used much more often). I would agree, except that nobody uses pax. :-) > > You've added both "A" and "-A", right? That is, you're still > > not using the presense/absense of a "-" to provide for separate > > BSD and UNIX switch namespaces. You wouldn't be caving to the > > Linux world if you did; I swiped the idea from Digital UNIX. > > (a.k.a. Tru64 or OSF/1) It's also in AIX. > > I think this is ugly. Also, scripts and users on BSD have started to > use a hyphen on BSD-style options, e.g. ps -ux. It may be the least bad > way out, though. Ultimately, it is the least bad way out. You might want to add a /usr/ucb/ps though. Then users can set $PATH to that when they want 100% old BSD behavior. Sun does this. Consider making /usr/ucb/ps a trivial script wrapper that sets an environment variable rather than having the main ps executable look at the path. > > > Adds a `-s sidlist' option, which is not in SUSv3, but > > > it is in solaris, linux, and irix -- and it's an > > > option I have personally wished for on occasion... > > > What about the traditional BSD signals format? I know NetBSD > > broke this... you too? It is valuable when debugging. > > -O sig,sigmask,sigignore,sigcatch does about that, but requires more > typing. The hexadecimal numbers are still annoying. How odd that you've lost "ps s" but retained the ability to produce the data! Zero-padded hex is pretty reasonable; it would allow you to count from either side. > Hmm, I rather like a getopt-based parser for the complicated stuff. > However, when the first argument doesn't start with a hyphen, FreeBSD ps > does weird things and I have at least one PR on file about that > ('ps tpt'). The common non-getopt parser crams everything into one big ugly while() loop. You needn't do that; simply break things up a bit as you would for any other code. It's quite readable that way. For example, hack-free handling for "t" is nicely localized: case 't': /* Select by tty. */ /* List of terminals (tty, pty...) _should_ follow t. */ arg=get_opt_arg(); if(!arg){ /* This is old BSD syntax. Put our tty on a tiny list. */ /* ... snip ... */ return NULL; } err=parse_list(arg, parse_tty); /* parse_tty is a function */ if(err) return err; selection_list->typecode = SEL_TTY; return NULL; /* can't have any more options */ > It has been discussed on freebsd-standards or -arch. Users may set > CMD_ENV=sysv if they want to use System V style options, but scripts > will not expect that. This requires all scripts using ps to be changed. Yes and no. You only have to break scripts using options that could be parsed either way. For example, my parser falls back to BSD mode if it sees "ps -axu". It also falls back to BSD mode for "ps -aux" if user "x" doesn't exist. Due to "x" being a commonly-used BSD-only option, it is rare to have a command that can parse either way. To gently break old habits, I give a warning when fall-back parsing is used. > Separate paths or names for the two seem like a better way. It seems > best that it's one binary that changes behaviour depending on argv[0], > but that makes it hard to call both of them by the name "ps". Sun is already using /usr/ucb for this. I suspect many people have this in their $PATH already. > > If you want it, I'll help somebody port the Linux ps. :-) > > I'll even consider a non-LGPL license if that changes things. > > Then you can enjoy near-perfect SunOS 4 goodness: > > > PS_PERSONALITY=sunos4 ps -aux > > PS_PERSONALITY=sunos4 ps -auxg > > I use almost all options of FreeBSD 4.x ps now and then, with > exception of the obscure '-C' option and the sorting options. > > I'm not especially fond of Linux ps. Some of my annoyances are: > > * It's over-complicated, supports options from many Unix variants. > This may be unavoidable in the end, though. Sure. Your HP-UX scripts will work though. > * 'ps axO user' doesn't show full argv ('ps ax' does) Hmmm, that could be considered a bug. I can change this. > * Doesn't have 'I', 'D', 's', '+' status letters "D" is there, along with "S" and "W". "s" and "+" seem kind of redundant, taking up valuable space. "I" can not be supported on Linux. > * 'sl' keyword doesn't work It might be doable, at least approximately, on a 2.6.xx kernel. A port to FreeBSD could of course have this working. (Wow, somebody actually uses the "sl" keyword! Can I assume you maintain the kernel's scheduler?) > Of course, some of these annoyances are due to the Linux kernel and not > due to procps itself. > > I don't find Linux ps as annoying as SysV ps that cannot show me all > processes running under my uid without me mentioning my uid on the > command line, and truncate long argv pretty quickly. Thanks for taking a look. Did I get FreeBSD's "H" option right? I'm not sure what the PID column is supposed to contain. Also, I'd be happy to support a FreeBSD-compatible "Z" if you can properly describe it to me. From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 13:08:01 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CE0F16A4CE for ; Thu, 25 Mar 2004 13:08:01 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 105B043D3F for ; Thu, 25 Mar 2004 13:08:01 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PL7xHB006672; Thu, 25 Mar 2004 16:08:00 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080247208.2232.1095.camel@cube> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> Date: Thu, 25 Mar 2004 16:07:58 -0500 To: Albert Cahalan , Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 21:08:01 -0000 At 3:40 PM -0500 3/25/04, Albert Cahalan wrote: > >Also, I'd be happy to support a FreeBSD-compatible "Z" if you >can properly describe it to me. This description from the source might help (since I have not written the man-page entry for it yet. Ahem...): case 'X': /* * Note that `-X' and `-x' are not standard "selector" * options. For most selector-options, we check *all* * processes to see if any are matched by the given * value(s). After we have a set of all the matched * processes, then `-X' and `-x' govern whether we * modify that *matched* set for processes which do * not have a controlling terminal. `-X' causes * those processes to be deleted from the matched * set, while `-x' causes them to be kept. */ xkeep = 0; break; case 'x': xkeep = 1; break; Before option-parsing, the variable xkeep starts out as -1, and xkeep_implied starts out as 0. Options like `-t' and `-G' set xkeep_implied = 1, because I think that's what we have to do to match the spirit of SUSv3. After option-parsing is done, there is: if (xkeep < 0) /* Neither -X nor -x was specified */ xkeep = xkeep_implied; The `-p pidlist' option does NOT set xkeep_implied, but the pidlist is checked before the xkeep variable, so processes are always matched no matter what value xkeep ends up with. The `-A' option will also set xkeep (not xkeep_implied). -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 14:09:36 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2787A16A4CE for ; Thu, 25 Mar 2004 14:09:36 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id D74E343D3F for ; Thu, 25 Mar 2004 14:09:35 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc12) with SMTP id <20040325220934012007dg7ae>; Thu, 25 Mar 2004 22:09:35 +0000 From: Albert Cahalan To: Garance A Drosihn In-Reply-To: References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> Content-Type: text/plain Organization: Message-Id: <1080252862.2255.1141.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 25 Mar 2004 17:14:23 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: Jilles Tjoelker cc: Albert Cahalan Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 22:09:36 -0000 On Thu, 2004-03-25 at 16:07, Garance A Drosihn wrote: > At 3:40 PM -0500 3/25/04, Albert Cahalan wrote: > > > >Also, I'd be happy to support a FreeBSD-compatible "Z" if you > >can properly describe it to me. > > This description from the source might help (since I have not > written the man-page entry for it yet. Ahem...): 'Z' != 'X' Thanks for the "X" info though. Supporting "X" this way would be seriously hard for me. I could do it as a final filter, but then "p" would be affected. I could add it into the table that does the non-list selection options, but then the list-based selections wouldn't be filtered. (my "-p 123" is affected if-and-only-if "-g 123" is too) I suppose the whole point is to filter processes out of the listed selections? This seems to be quite a bit of complexity for little gain. It looks like you're headed toward something that might best be done like: ps --match="ruid in 1,1000,1082 && tty!=NOTTY" (instead of approaching it hack-by-hack over the years) I think "ps xX" should be an error, and maybe "ps xx" too. From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 15:10:28 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8562716A4CE for ; Thu, 25 Mar 2004 15:10:28 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17F9643D39 for ; Thu, 25 Mar 2004 15:10:28 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PNAQLP018026; Thu, 25 Mar 2004 18:10:27 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080252862.2255.1141.camel@cube> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> <1080252862.2255.1141.camel@cube> Date: Thu, 25 Mar 2004 18:10:25 -0500 To: Albert Cahalan From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 23:10:28 -0000 At 5:14 PM -0500 3/25/04, Albert Cahalan wrote: >On Thu, 2004-03-25 at 16:07, Garance A Drosihn wrote: >> At 3:40 PM -0500 3/25/04, Albert Cahalan wrote: >> > > > >Also, I'd be happy to support a FreeBSD-compatible "Z" if > > >you can properly describe it to me. > > > > This description from the source might help (since I have > > not written the man-page entry for it yet. Ahem...): > >'Z' != 'X' Oops. That just shows what happens when I don't get enough sleep! `ps -Z' is an option which modifies the output format to add a column called "LABEL". It is only in 5.x, and looking at the code I am not sure that it interacts all that well with the other `-o' options. But if you specify `-Z' before any other output-option, then this LABEL column shows up as the first column of output. What it shows is the MAC (Mandatory Access Control) label for processes. All my processes show up with a blank LABEL field, because I'm not actually doing anything with MAC's yet. I know very little about MAC-support. Perhaps the following will help: http://www.freebsd.org/cgi/man.cgi?query=lomac&manpath=FreeBSD+5.2-current >Thanks for the "X" info though. Supporting "X" this way >would be seriously hard for me. I'd be happy enough if you just treated it as a no-op :-). >I suppose the whole point is to filter processes out >of the listed selections? The point is just to have a reverse of -x. I really wanted options like '-G' to *not* show these processes by default, but someone pointed out that doing that would be incompatible with how other OS's handle those options. But in BSD-land, a `ps' all by itself defaults to what I'm calling `-X' (which is why we have a `-x' option in the first place). >This seems to be quite a bit of complexity for little gain. We already have -x. Adding -X is almost zero complexity in our code path. Most of the update for it is just that block of comments which I sent in my previous message. >It looks like you're headed toward something that might >best be done like: > ps --match="ruid in 1,1000,1082 && tty!=NOTTY" Uh, now adding *THAT* would add a huge amount of complexity to our `ps'! Wow! >(instead of approaching it hack-by-hack over the years) Well, I do not picture a series of similar hacks. I am just trying to make some sense out of our already-existing `-x' option vs. the way options like `-G' are supposed to work according to the standards. >I think "ps xX" should be an error, and maybe "ps xx" too. Nah. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 23:41:30 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03E5616A4CE for ; Thu, 25 Mar 2004 23:41:30 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id A644D43D1D for ; Thu, 25 Mar 2004 23:41:29 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2Q7fTLP016066 for ; Fri, 26 Mar 2004 02:41:29 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Fri, 26 Mar 2004 02:41:27 -0500 To: freebsd-standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: newer PATCH for a more-POSIX `ps' X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 07:41:30 -0000 At 3:51 PM -0500 3/20/04, Garance A Drosihn wrote: >That does not get us matching POSIX/SUSv3, but it does get us a >lot closer. ... > >The update ... is available at: >http://people.freebsd.org/~gad/ps-susv3.diff I have a new version of the update at the above location. This is what I expect to commit this weekend. There were a few debatable options (`-g pgidlist', `-R ruserlist' or `-s sidlist'), and for the moment I am side-stepping the debate by #ifdef-ing out some of the code for those options. This also includes a plausible update for the man page. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 00:43:29 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6C8F16A4DD; Fri, 26 Mar 2004 00:43:29 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5192A43D2F; Fri, 26 Mar 2004 00:43:29 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id E11D75309; Fri, 26 Mar 2004 09:43:27 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 6E56C5308; Fri, 26 Mar 2004 09:43:21 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 3FC8633CA7; Fri, 26 Mar 2004 09:43:21 +0100 (CET) To: Albert Cahalan References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 26 Mar 2004 09:43:21 +0100 In-Reply-To: <1080247208.2232.1095.camel@cube> (Albert Cahalan's message of "25 Mar 2004 15:40:08 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: Jilles Tjoelker cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 08:43:30 -0000 Albert Cahalan writes: > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > I think that has been a historical mistake in the POSIX standardization. > > tar/cpio were not standardized, instead a new utility "pax" was > > invented. This should have been done with ps too [...] > I would agree, except that nobody uses pax. :-) NetBSD and OpenBSD use pax exclusively; their tar and cpio are symlinks to /bin/pax. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 06:34:09 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0197316A4CE; Fri, 26 Mar 2004 06:34:09 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8193043D45; Fri, 26 Mar 2004 06:34:08 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B6sPO-00064a-DO; Fri, 26 Mar 2004 20:34:06 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2QEYDxm002748; Fri, 26 Mar 2004 20:34:13 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2QEYBnX002695; Fri, 26 Mar 2004 20:34:12 +0600 (NOVT) (envelope-from danfe) Date: Fri, 26 Mar 2004 20:34:11 +0600 From: Alexey Dokuchaev To: Dag-Erling Sm?rgrav Message-ID: <20040326143411.GA1508@regency.nsu.ru> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: Jilles Tjoelker cc: freebsd-standards@freebsd.org cc: Albert Cahalan cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 14:34:09 -0000 On Fri, Mar 26, 2004 at 09:43:21AM +0100, Dag-Erling Sm?rgrav wrote: > Albert Cahalan writes: > > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > > I think that has been a historical mistake in the POSIX standardization. > > > tar/cpio were not standardized, instead a new utility "pax" was > > > invented. This should have been done with ps too [...] > > I would agree, except that nobody uses pax. :-) > > NetBSD and OpenBSD use pax exclusively; their tar and cpio are > symlinks to /bin/pax. How do they handle tar/cpio-specific arguments than? By bloating pax(1) with quite some piece of code? This seems odd. ./danfe From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 14:15:02 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D101B16A4CE; Fri, 26 Mar 2004 14:15:02 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1BEC43D1D; Fri, 26 Mar 2004 14:15:01 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id CC6329BB60; Fri, 26 Mar 2004 23:15:45 +0100 (CET) Message-ID: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: , "Garance A Drosihn" References: Date: Fri, 26 Mar 2004 23:14:59 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: Alexey Dokuchaev cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:15:03 -0000 "Garance A Drosihn" wrote: > [this is BCC'ed to -arch so more people have a chance to see it, but > I expect most of the discussion to happen in freebsd-standards]. argh! thread not seen before. please, see my post in -arch entiled : posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) > It started out that I just wanted to get rid of one message that > `ps' writes to stderr in -current but not in -stable. "As long as > I was there", I thought I'd add support for a comma-separated list > of processes for `ps -p' (as described in SUSv3). Alexey Dokuchaev > asked if this change got us much closer to POSIX/SUS. Now it did > get us a *little* closer, but in re-reading SUSv3 I realized that > I didn't get it (that one option) quite as close as I would like. > So, "as long as I was there", I figured I should try to come a > little closer. > > Now, after about 30 consecutive "as long as I was there" small > projects, I have an update which: > Changes -p so it accepts a list of process IDs, and -t so > it accepts a list of terminal names (instead of only > allowing a single value). done also > Adds the -A option of SUSv3 (exactly the same as `-ax') well, if sunos -g option is added (done in my implementation), -A (posix) is more -agx than -ax, while -d (posix) stands for -ag. > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > (note that this replaced a null `-g' option...) also done. > Adds a `-R ruserlist' option, which is the same as what > SYSv3 describes for `-u' (we already have a `-u'). > Amazingly, none of solaris, linux, or irix seem to > have any kind of `-R' option. please, don't. for two reason : - don't try to mix bsd/posix options. this will be more confusing to have yet another non conformant option. - prefer a switch and/or environment variable to switch between bsd and posix syntax. and stay conformant to each syntax depending to which syntax was selected. a kind of what is done on tru64 (w/ or w/o dash), irix (_XPG=1 env), hpux (UNIX95=1 env), linux (PS_PERSONALITY=posix env), etc. > Adds a `-s sidlist' option, which is not in SUSv3, but > it is in solaris, linux, and irix -- and it's an > option I have personally wished for on occasion... also done. > Allows the user to specify any of these "selector options" > multiple times, and have it keep adding to that > list instead of replacing values for that list. also done > Better parsing of options. Better error messages for > invalid values (IMO). also done. > Fixes interactions between all these "selector options", > & our `-x' option (which is not mentioned in SUSv3). > For the selector options, I tried to meet the > description of: "If any are specified, the default > list shall be ignored and ps shall select the > processes represented by the inclusive OR of all > the selection-criteria options." not seen, so, not done for instance but will be. > Applies all these selection criteria *before* sorting > the list of processes we get from kvm_getprocs(), > and before using the list to compute the sizes of > the output fields. not done but cleaner. > That does not get us matching POSIX/SUSv3, but it does get us a > lot closer. There are a few questions/issues that came up for me > while writing this, but I'll list those in separate messages. I'll > also do a minimal update to the man page before commiting this. > > I wanted to do this without bloating up the size of `ps' by too > much, and on i386 the executable has grown by --- 164 bytes! > (0.6% increase)! [at this point I will do a touchdown-style > victory dance, and spike my keyboard into the floor...] > > The update weighs in at almost 900 lines, and is available at: > http://people.freebsd.org/~gad/ps-susv3.diff > > I certainly didn't intend to end up with that large of an update, > but at this point I'm not going to go back and try to break it > down into 30 separate updates of 50 lines each... > > Please look it over, try it out, and let me know if these options > seem to work the way you'd expect them to, or if I have messed > anything up. And please please PLEASE -- don't give me any more > ideas of something *else* I could do "as long as I'm there"! my first implementation statically add all susv3 plus some solaris options, many keywords or aliases. the current implementation I'm working on may dynamically switch between one or another syntax (principally bsd, posix, hpux, irix, sunos, solaris (posix and ucb) and tru64(posix and bsd)) and may also combine some of them. I could provide you the patch for the statically (#ifdef's) posix adds or, if you prefer to wait a week or two, a patch for the dynamically posix adds I'm working on. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 14:36:33 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B68E316A4CE; Fri, 26 Mar 2004 14:36:33 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5910543D4C; Fri, 26 Mar 2004 14:36:33 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2QMaWXf016866; Fri, 26 Mar 2004 17:36:32 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> References: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> Date: Fri, 26 Mar 2004 17:36:30 -0500 To: "Cyrille Lefevre" , From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: Alexey Dokuchaev cc: Albert Cahalan cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:36:33 -0000 At 11:14 PM +0100 3/26/04, Cyrille Lefevre wrote: >"Garance A Drosihn" wrote: > > > [this is BCC'ed to -arch so more people have a chance to see > > it, but I expect most of the discussion to happen in > > freebsd-standards]. > >argh! thread not seen before. please, see my post in -arch entiled : >posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) You need to catch up on the entire thread before replying. If you are only following -arch, then note that most of the discussion has happened in -standards. Let me save you a little concern, and say that "for now" I have backed away from any of the options where there has been some debate over whether the option would create more headaches than it solves. (most of them are still in the code, but #ifdef'ed out until I do some more thinking). If nothing else, make sure you understand my latest patch, which I intend to commit tonight or tomorrow. The ship has pretty much sailed at this point, because I can't just keep increasing the size of the patch and throwing around multi-hundred line emails every two hours for the next two months. I need to commit the part that I have now, and then think of what I want to do next. We are not going to commit one 10,000 line patch to `ps', attempting to solve every problem ever known to man all at once. I am fairly confident that the 1,000 line patch that I have right now is safe, and is a step forward, and does not bloat the size of /bin/ps, and does not get us into much trouble wrt future changes. Those are all good things. I intend to commit what I have written and debugged. I just sort of stumbled into this `ps' issue last week, and I have worked many hours on what I have done. I know it falls far short of the perfect solution, but I am doing something and I am willing to listen to further ideas. However, I cannot devote my life to `ps', so I will juggle this work with all the other work that I'm trying to do. [I'm also several lines in to a reply to your other message to freebsd-arch, but I'll send this shorter reply right now...] -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 14:51:31 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4163F16A4CE; Fri, 26 Mar 2004 14:51:31 -0800 (PST) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5D6D43D2D; Fri, 26 Mar 2004 14:51:30 -0800 (PST) (envelope-from root@gits.dyndns.org) Received: from mail.gits.dyndns.org (unknown [81.185.204.209]) by ioskeha.hittite.isp.9tel.net (Postfix) with ESMTP id 3FAF817B4B9; Fri, 26 Mar 2004 23:51:42 +0100 (CET) Received: from pc2k (pc2k [192.168.144.120]) by mail.gits.dyndns.org (8.12.10/8.12.10) with SMTP id i2QMpOSP089150; Fri, 26 Mar 2004 23:51:25 +0100 (CET) (envelope-from root@gits.dyndns.org) Message-ID: <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Albert Cahalan" , References: <1080334271.2255.1301.camel@cube> Date: Fri, 26 Mar 2004 23:51:24 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-100 required=5 tests=USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.38 cc: freebsd-standards@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:51:31 -0000 "Albert Cahalan" wrote: > Cyrille Lefevre writes: > > > two years ago, I've added posix syntax and so to my locally ps(1). > > for instance, I'm currently adding the notion of dynamic personalities > > OK, would YOU be interested in working with me on some sort of > common ps specification beyond what SUSv3 has to offer? I'd love > to see something that Sun could adopt, and that could be mostly > merged into the next revision of the standard. why not :) > > (the term comes from linux) instead of static #define such as... say : > > > > $ ps -X help > > any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd > > pedantic posix relaxed solaris sunos susv3 tru64 > > So you use "-X" as an escape into long options? Why not "--help"? no, PERSONALITY=solaris is the same as -X solaris. -X is the option I use to switch between personalities. so, -X help is a sort of -L which lists available keywords. -o help in the posix syntax stands for -L in the bsd syntax. I don't use -L as in the bsd syntax to avoid a conflict with -L which permit to list threads in the solaris syntax. > > personalities enable options such as : > > bsd ps : > > -g and -n from sunos, -s from tru64 and some other options. > > posix ps : see susv3 man (see > > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > > -j from all except posix > > -c, -y and -P from solaris > > -C cmdlist (ala pgrep :) and -x from hpux > > That "-x" will hurt you. Without it, it is easy for a SUSv3 parser > to detect the common old "ps -ax" syntax. well, hpux -f only list the first 64 characters of a command line (where solaris list the first 80 ones), the hpux -x option is equivalent to the bsd -ww option. > BTW, I have a regression test suite that you might find useful. yes, of course. for instance, I'm trying to resolve header's naming, say user is USER or UID depending of the personality... etc. > > -M from irix > > Do you have documentation or examples for this? irix -M is freebsd -Z, so, simple to implement :) > > and some others > > they also enable many keywords such as : > > RUSAGE and co from tru64, class and psr from solaris, and many others > > (mostly aliases) > > > > when finished, I'll probably submit these changes as a port in the meantime > > since I suppose -arch will reject these important changes to a native command. > > the most important and not done part is... the manual page. any volonteers ? > > Step 1: > > a. ps does old BSD behavior by default true > b. /posix/bin/ps is a script that sets the SUSv3 personality > c. /usr/ucb/ps is a link to /bin/ps no problem. > Step 2: > > a. ps does SUSv3 by default > b. /posix/bin/ps is a link to /bin/ps > c. /usr/ucb/ps is a script that sets the old BSD personality > > > $ PERSONALITY=susv3,+extended ps -? > > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] > > ps -o help > > ps -X help > > What syntax do you use for PERSONALITY settings? Let's do > something compatible. [=+-]keyword[,[=+-]keyword ...] "=" is optional and say "this personality", "+" say add "this personality" to the previous one, and "-" say delete "this personality" to the previous one. possible personalities by themself are : bsd43reno bsd44 default freebsd hpux irix netbsd openbsd solaris sunos susv3 tru64 any : all above none : none of the above possible switches bsd : bsd syntax extended : allow enhanced options and keywords. pedantic : be strict about the syntax (-p pid instead of -p pidlist) posix : posix syntax (! bsd) relaxed : ! pedantic some examples : tru64,-posix is equivalent to tru64,+bsd since tru64 implies +posix freebsd,-pedantic,+extended allow -p pidlist, -g and -n sunos options and -s tru64 options. susv3,+extended is strictly posix but allow the following options : -C cmdlist hpux : select processes by name -c irix/hpux/solaris : omit c and nice column, add cls column -j irix/hpux/solaris/tru64 : job control informations -O fmtlist bsd/tru64 : pid fmtlist s tty time comm -P hpux/solaris : add psr column -s sidlist irix/hpux/solaris/tru64 : select process by session id -x hpux : equivalent to -ww bsd option -y solaris : omit f and addr columns, add rss column > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > more than just ps. I made PS_PERSONALITY take priority so that > you could change ps behavior without changing other behaviors. PS_PERSONALITY is the name that linux uses. this may conflict in .profiles since the syntax is different. to complete what you say : irix uses _XPG=1 and hpux uses UNIX95=1 of course, all of them could be tested for more and more compatobility :) > You forgot the "-F" from DYNIX/ptx. It's really nice. any pointer ? Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 16:08:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E08E16A4CE; Fri, 26 Mar 2004 16:08:25 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 340C043D3F; Fri, 26 Mar 2004 16:08:25 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc12) with SMTP id <2004032700082301200605dfe>; Sat, 27 Mar 2004 00:08:24 +0000 From: Albert Cahalan To: Cyrille Lefevre In-Reply-To: <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> Content-Type: text/plain Organization: Message-Id: <1080346391.2255.1347.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 19:13:11 -0500 Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org cc: Albert Cahalan Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 00:08:25 -0000 On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > "Albert Cahalan" wrote: > > > Cyrille Lefevre writes: > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > for instance, I'm currently adding the notion of dynamic personalities > > > > OK, would YOU be interested in working with me on some sort of > > common ps specification beyond what SUSv3 has to offer? I'd love > > to see something that Sun could adopt, and that could be mostly > > merged into the next revision of the standard. > > why not :) Great. Unless people object, I'll wipe the Cc: list for this. BTW, I hadn't meant to imply that any other person was being some kind of uncooperative prick. We all have time constraints and plenty of projects. > > So you use "-X" as an escape into long options? Why not "--help"? > > no, PERSONALITY=solaris is the same as -X solaris. -X is the option > I use to switch between personalities. so, -X help is a sort of -L which > lists available keywords. -o help in the posix syntax stands for -L in > the bsd syntax. I don't use -L as in the bsd syntax to avoid a > conflict with -L which permit to list threads in the solaris syntax. Oh, OK. It's kind of weird, since "ps -o pid,help,comm" would seem to be something for 3 columns, but suit yourself. I didn't bother, thinking "ps L" and "man ps" would do. I suppose the -X has to be the first option...? > > > personalities enable options such as : > > > bsd ps : > > > -g and -n from sunos, -s from tru64 and some other options. > > > posix ps : see susv3 man (see > > > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > > > -j from all except posix > > > -c, -y and -P from solaris > > > -C cmdlist (ala pgrep :) and -x from hpux > > > > That "-x" will hurt you. Without it, it is easy for a SUSv3 parser > > to detect the common old "ps -ax" syntax. > > well, hpux -f only list the first 64 characters of a command line > (where solaris list the first 80 ones), the hpux -x option is > equivalent to the bsd -ww option. Eh, "-ww" plus turning on argument display, right? It's the opposite of BSD "c" AFAIK, and implied by "-f". > > BTW, I have a regression test suite that you might find useful. > > yes, of course. for instance, I'm trying to resolve header's naming, > say user is USER or UID depending of the personality... etc. First of all, perfection is the enemy of good. Part of my solution: {"uid_hack", "UID", pr_euser, sr_nop, 8, USR, XXX, ET|USER}, > > > -M from irix > > > > Do you have documentation or examples for this? > > irix -M is freebsd -Z, so, simple to implement :) It's never that simple. > > > $ PERSONALITY=susv3,+extended ps -? > > > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > > > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > > > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X > perslist] > > > ps -o help > > > ps -X help > > > > What syntax do you use for PERSONALITY settings? Let's do > > something compatible. > > [=+-]keyword[,[=+-]keyword ...] > > "=" is optional and say "this personality", "+" say add "this personality" > to the previous one, and "-" say delete "this personality" to the previous one. > > possible personalities by themself are : > bsd43reno bsd44 default freebsd hpux irix netbsd openbsd solaris sunos susv3 > tru64 > any : all above > none : none of the above The bsd43reno/bsd44/freebsd distinction is interesting. I hope you'll add "linux" to your list. :-) I was hoping that your syntax covered fall-back choices. Then I could ask for "unixware" as a first choice, and for "posix" if "unixware" is unknown. > possible switches > bsd : bsd syntax > extended : allow enhanced options and keywords. > pedantic : be strict about the syntax (-p pid instead of -p pidlist) It's normal to allow a list. The list is either the remaining part of the current argument ("ps -p42,45,16") or the next one. I ban crud like "ps -p 42,,7" and "ps -p ,42,91,". > > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > > more than just ps. I made PS_PERSONALITY take priority so that > > you could change ps behavior without changing other behaviors. > > PS_PERSONALITY is the name that linux uses. this may conflict in > .profiles since the syntax is different. to complete what you say : > irix uses _XPG=1 and hpux uses UNIX95=1 > of course, all of them could be tested for more and more compatobility :) Heh. I do in fact check _XPG=1 and UNIX95=1. > > You forgot the "-F" from DYNIX/ptx. It's really nice. > > any pointer ? It's a friendly format, kind of along the lines of BSD "u". $ ps -F UID PID PPID C SZ RSS PSR STIME TTY TIME CMD albert 21666 21665 1 770 1672 0 19:11 pts/14 00:00:00 bash albert 21674 21666 0 744 880 0 19:11 pts/14 00:00:00 ps -F From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 16:59:52 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14C3716A4CE; Fri, 26 Mar 2004 16:59:52 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F9F143D2D; Fri, 26 Mar 2004 16:59:51 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004032700594801100mqei9e>; Sat, 27 Mar 2004 00:59:50 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA94972; Fri, 26 Mar 2004 17:05:31 -0800 (PST) Date: Fri, 26 Mar 2004 17:05:29 -0800 (PST) From: Julian Elischer To: Albert Cahalan In-Reply-To: <1080346391.2255.1347.camel@cube> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 00:59:52 -0000 On 26 Mar 2004, Albert Cahalan wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > > > Cyrille Lefevre writes: > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > OK, would YOU be interested in working with me on some sort of > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > to see something that Sun could adopt, and that could be mostly > > > merged into the next revision of the standard. > > > > why not :) > > Great. Unless people object, I'll wipe the Cc: list for this. Not objecting, but just making sure who is in this before it goes away.. 1/ Linux ps maintainer.? 2/ Someone fro FreeBSD with interest in ps? 3/ anyone else? From owner-freebsd-standards@FreeBSD.ORG Fri Mar 26 17:22:31 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E752516A4CE; Fri, 26 Mar 2004 17:22:31 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5F1543D46; Fri, 26 Mar 2004 17:22:31 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc13) with SMTP id <2004032701222901500du28ie>; Sat, 27 Mar 2004 01:22:31 +0000 From: Albert Cahalan To: Julian Elischer In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1080350838.2232.1413.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 20:27:18 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 01:22:32 -0000 On Fri, 2004-03-26 at 20:05, Julian Elischer wrote: > On 26 Mar 2004, Albert Cahalan wrote: > > > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > > "Albert Cahalan" wrote: > > > > > > > Cyrille Lefevre writes: > > > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > > > OK, would YOU be interested in working with me on some sort of > > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > > to see something that Sun could adopt, and that could be mostly > > > > merged into the next revision of the standard. > > > > > > why not :) > > > > Great. Unless people object, I'll wipe the Cc: list for this. > > Not objecting, but just making sure who is in this before it goes away.. > 1/ Linux ps maintainer.? yes (me) > 2/ Someone fro FreeBSD with interest in ps? yes (Cyrille Lefevre) > 3/ anyone else? None yet. Do you happen to know the right people at any of the UNIX(R) shops? Rough idea of direction: 1. get some wiki-like thing for editing a document 2. define a fair "extended ps" compromise 3. based on that, patch the SUSv3 ps specification 4. get Linux, one BSD, one SysV, and one OSF/1 to conform 5. get some of the changes into SUSv4 (deadline?) From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 01:02:53 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20CAA16A4CE; Sat, 27 Mar 2004 01:02:53 -0800 (PST) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDAEA43D2D; Sat, 27 Mar 2004 01:02:52 -0800 (PST) (envelope-from root@gits.dyndns.org) Received: from mail.gits.dyndns.org (unknown [81.185.204.209]) by ioskeha.hittite.isp.9tel.net (Postfix) with ESMTP id B7A1517B488; Sat, 27 Mar 2004 10:03:04 +0100 (CET) Received: from pc2k (pc2k [192.168.144.120]) by mail.gits.dyndns.org (8.12.10/8.12.10) with SMTP id i2R91VSP092472; Sat, 27 Mar 2004 10:01:32 +0100 (CET) (envelope-from root@gits.dyndns.org) Message-ID: <1c0001c413da$19e89e10$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Albert Cahalan" References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> <1080346391.2255.1347.camel@cube> Date: Sat, 27 Mar 2004 09:56:49 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-100 required=5 tests=USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.38 cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 09:02:53 -0000 "Albert Cahalan" wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > Cyrille Lefevre writes: [snip] > Oh, OK. It's kind of weird, since "ps -o pid,help,comm" > would seem to be something for 3 columns, but suit yourself. > I didn't bother, thinking "ps L" and "man ps" would do. > > I suppose the -X has to be the first option...? not necesserally, but usually :) I prefer the env var use. [snip] > Eh, "-ww" plus turning on argument display, right? > It's the opposite of BSD "c" AFAIK, and implied by "-f". not exactly, -f is a sort of -w, and -fx is a true -ww. another solution would be to double -f, say -ff, but nobody seems to implement that AFAIK. > > > BTW, I have a regression test suite that you might find useful. > > > > yes, of course. for instance, I'm trying to resolve header's naming, > > say user is USER or UID depending of the personality... etc. > > First of all, perfection is the enemy of good. I know, but I'm like that... perfectionist. > Part of my solution: > {"uid_hack", "UID", pr_euser, sr_nop, 8, USR, XXX, ET|USER}, well, for instacance, I keyword aliases w/ personalities : ALIAS("user", "UID", "user", _SUSV3|_HPUX|_SOLARIS), SIZE("user", "USER", LJUST, uname, s_uname, USER, _BSD44|_FREE|_NET|_OPEN|_SUNOS|_IRIX|_TRU64), but that part is not completed and has not been validated, yet. ALIAS and SIZE (aka CALL w/ DSIZ) are macros which greatly improve the readability of the keywords array. > > > > -M from irix > > > > > > Do you have documentation or examples for this? > > > > irix -M is freebsd -Z, so, simple to implement :) > > It's never that simple. reading the manual page, yes. but I have no testing machine for that. [snip] > The bsd43reno/bsd44/freebsd distinction is interesting. > I hope you'll add "linux" to your list. :-) at last, since the linux manual page is really poor and the code ir really unreadable. > I was hoping that your syntax covered fall-back choices. please, explain your mind by fall-back choices ? for instance, -X unknown gives up w/ an error message and the list of choices. > Then I could ask for "unixware" as a first choice, and > for "posix" if "unixware" is unknown. unixware could be an alias on plain susv3. in my mind, posix just say posix syntax. > > possible switches > > bsd : bsd syntax > > extended : allow enhanced options and keywords. > > pedantic : be strict about the syntax (-p pid instead of -p pidlist) > > It's normal to allow a list. The list is either the remaining > part of the current argument ("ps -p42,45,16") or the next one. > I ban crud like "ps -p 42,,7" and "ps -p ,42,91,". no problem for that, empty values are ignored. > > > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > > > more than just ps. I made PS_PERSONALITY take priority so that > > > you could change ps behavior without changing other behaviors. > > > > PS_PERSONALITY is the name that linux uses. this may conflict in > > .profiles since the syntax is different. to complete what you say : > > irix uses _XPG=1 and hpux uses UNIX95=1 > > of course, all of them could be tested for more and more compatobility :) > > Heh. I do in fact check _XPG=1 and UNIX95=1. > > > > You forgot the "-F" from DYNIX/ptx. It's really nice. > > > > any pointer ? > > It's a friendly format, kind of along the lines of BSD "u". > > $ ps -F > UID PID PPID C SZ RSS PSR STIME TTY TIME CMD > albert 21666 21665 1 770 1672 0 19:11 pts/14 00:00:00 bash > albert 21674 21666 0 744 880 0 19:11 pts/14 00:00:00 ps -F well, a kind of solaris ps -clPy but shorter :) S UID PID PPID CLS PSR PRI RSS SZ WCHAN TTY TIME CMD Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 01:58:23 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0F4F16A4CE; Sat, 27 Mar 2004 01:58:23 -0800 (PST) Received: from amsfep16-int.chello.nl (amsfep16-int.chello.nl [213.46.243.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8919C43D31; Sat, 27 Mar 2004 01:58:22 -0800 (PST) (envelope-from dodell@sitetronics.com) Received: from sitetronics.com ([213.46.139.145]) by amsfep16-int.chello.nl ESMTP <20040327095821.QLPE26437.amsfep16-int.chello.nl@sitetronics.com>; Sat, 27 Mar 2004 10:58:21 +0100 Message-ID: <40654F5D.5010004@sitetronics.com> Date: Sat, 27 Mar 2004 10:54:37 +0100 From: "Devon H. O'Dell" User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Albert Cahalan References: <1080350838.2232.1413.camel@cube> In-Reply-To: <1080350838.2232.1413.camel@cube> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: Julian Elischer cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 09:58:24 -0000 Albert Cahalan wrote: > [snip] > None yet. Do you happen to know the right people > at any of the UNIX(R) shops? > > Rough idea of direction: > > 1. get some wiki-like thing for editing a document I'd be happy and willing to set this up. Any preference on the system used? I can do this immediately. > 2. define a fair "extended ps" compromise > 3. based on that, patch the SUSv3 ps specification > 4. get Linux, one BSD, one SysV, and one OSF/1 to conform > 5. get some of the changes into SUSv4 (deadline?) Is there any way I can help with the above? I'm definitely interested in helping make FreeBSD more standards compliant and helping with suggestions for standards as well. Kind regards, Devon H. O'Dell From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 04:05:58 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55C5B16A4CE; Sat, 27 Mar 2004 04:05:58 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id F399043D39; Sat, 27 Mar 2004 04:05:57 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B7CZg-0000d6-Cg; Sat, 27 Mar 2004 18:06:04 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2R8kxxm054901; Sat, 27 Mar 2004 14:46:59 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2R8kw9T054801; Sat, 27 Mar 2004 14:46:58 +0600 (NOVT) (envelope-from danfe) Date: Sat, 27 Mar 2004 14:46:58 +0600 From: Alexey Dokuchaev To: Albert Cahalan Message-ID: <20040327084657.GA49799@regency.nsu.ru> References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> <1080346391.2255.1347.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1080346391.2255.1347.camel@cube> User-Agent: Mutt/1.4.1i cc: Cyrille Lefevre cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org cc: arch@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 12:05:58 -0000 On Fri, Mar 26, 2004 at 07:13:11PM -0500, Albert Cahalan wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > > > Cyrille Lefevre writes: > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > OK, would YOU be interested in working with me on some sort of > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > to see something that Sun could adopt, and that could be mostly > > > merged into the next revision of the standard. > > > > why not :) > > Great. Unless people object, I'll wipe the Cc: list for this. Hmm. You could probably consider keeping freebsd-standards@ in, though. ./danfe From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 05:37:59 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0F2616A4CE; Sat, 27 Mar 2004 05:37:59 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A94E43D2F; Sat, 27 Mar 2004 05:37:59 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id 773329BC7F; Sat, 27 Mar 2004 14:38:43 +0100 (CET) Message-ID: <1cd201c41400$b6e960c0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Alexey Dokuchaev" , "Dag-Erling Sm?rgrav" References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl><1080247208.2232.1095.camel@cube> <20040326143411.GA1508@regency.nsu.ru> Date: Sat, 27 Mar 2004 14:31:18 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: drosih@rpi.edu cc: freebsd-arch@freebsd.org cc: freebsd-standards@freebsd.org cc: Jilles Tjoelker cc: Albert Cahalan Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 13:38:00 -0000 "Alexey Dokuchaev" wrote: > On Fri, Mar 26, 2004 at 09:43:21AM +0100, Dag-Erling Sm?rgrav wrote: > > Albert Cahalan writes: > > > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > > > I think that has been a historical mistake in the POSIX standardization. > > > > tar/cpio were not standardized, instead a new utility "pax" was > > > > invented. This should have been done with ps too [...] > > > I would agree, except that nobody uses pax. :-) > > > > NetBSD and OpenBSD use pax exclusively; their tar and cpio are > > symlinks to /bin/pax. > > How do they handle tar/cpio-specific arguments than? By bloating pax(1) > with quite some piece of code? This seems odd. the code is already there. let's try : $ ln -s /tmp/tar /bin/pax $ ln -s /tmp/cpio /bin/pax $ /tmp/tar -? usage: pax [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] [archive] [replstr] [-C directory] [-I file] [file ...] $ /tmp/tar -? usage: pax -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive] [-F archive] < name-list [> archive] usage: pax -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format] [-I archive] [-F archive] [pattern...] [< archive] usage: pax -p [-adlLmuvV] destination-directory < name-list see also PR#38256 (http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/38256) Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 06:30:19 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07FA216A4CE for ; Sat, 27 Mar 2004 06:30:18 -0800 (PST) Received: from iteso.mx (iteso.mx [148.201.1.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C0DB43D31 for ; Sat, 27 Mar 2004 06:30:18 -0800 (PST) (envelope-from eric@iteso.mx) Received: from iteso.mx (localhost [127.0.0.1]) by iteso.mx (8.12.3/8.12.3/Debian-6.6) with ESMTP id i2REUHLj011351 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 27 Mar 2004 08:30:17 -0600 Received: (from www-data@localhost) by iteso.mx (8.12.3/8.12.3/Debian-6.6) id i2REUHq5011350 for freebsd-standards@FreeBSD.org; Sat, 27 Mar 2004 08:30:17 -0600 From: Eric De la Cruz Lugo X-Authentication-Warning: iteso.mx: www-data set sender to eric@iteso.mx using -f Received: from dup-148-233-218-42.prodigy.net.mx (dup-148-233-218-42.prodigy.net.mx [148.233.218.42]) by iteso.mx (IMP) with HTTP for ; Sat, 27 Mar 2004 08:30:17 -0600 Message-ID: <1080397817.40658ff979c2e@iteso.mx> Date: Sat, 27 Mar 2004 08:30:17 -0600 To: freebsd-standards@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 148.233.218.42 X-Virus-Scanned: clamd / ClamAV version 0.67+CVS20040305, clamav-milter version 0.67j Subject: Question about strtof() function under FreeBSD 4.9 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 14:30:19 -0000 Hi All: I just need to know if the strtof function in will be implemented soon in the 4.9 Release, I checked the status and the 5.x Branch has it already, will be long before 4.9 has it too? thanks in advance for your help, please reply to my address because am not in the list. Am trying to compile a POS software (Linux, BananaPos) and in one code I need that function strtof(). showl I upgrade to 5.2.1? thanks in advance. Eric De La Cruz Lugo Merida, Yucatan, Mexico. --- From owner-freebsd-standards@FreeBSD.ORG Sat Mar 27 07:10:12 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CB2A16A4CE; Sat, 27 Mar 2004 07:10:12 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE2F843D2D; Sat, 27 Mar 2004 07:10:11 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc11) with SMTP id <20040327151010011001qol9e>; Sat, 27 Mar 2004 15:10:11 +0000 From: Albert Cahalan To: "Devon H. O'Dell" In-Reply-To: <40654F5D.5010004@sitetronics.com> References: <1080350838.2232.1413.camel@cube> <40654F5D.5010004@sitetronics.com> Content-Type: text/plain Organization: Message-Id: <1080400499.2232.1521.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 27 Mar 2004 10:14:59 -0500 Content-Transfer-Encoding: 7bit cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: Julian Elischer cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 15:10:12 -0000 On Sat, 2004-03-27 at 04:54, Devon H. O'Dell wrote: > Albert Cahalan wrote: > > [snip] > > None yet. Do you happen to know the right people > > at any of the UNIX(R) shops? > > > > Rough idea of direction: > > > > 1. get some wiki-like thing for editing a document > > I'd be happy and willing to set this up. Any preference on the system > used? I can do this immediately. Just a generic idea: * must have enough control to keep out trolls and spammers * colored text or boxes, for commentary or optional parts * can undo changes * recent changes highlighted or diffs available > > 2. define a fair "extended ps" compromise > > 3. based on that, patch the SUSv3 ps specification > > 4. get Linux, one BSD, one SysV, and one OSF/1 to conform > > 5. get some of the changes into SUSv4 (deadline?) > > Is there any way I can help with the above? I'm definitely interested in > helping make FreeBSD more standards compliant and helping with > suggestions for standards as well. Sure, if you either have experience hacking ps code or you know about ps behavior on a wide variety of systems.