From owner-freebsd-standards@FreeBSD.ORG Sat Apr 24 15:11:07 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 23CBE16A4CE for ; Sat, 24 Apr 2004 15:11:07 -0700 (PDT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92B0743D45 for ; Sat, 24 Apr 2004 15:11:06 -0700 (PDT) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010::132]) by mailhost.stack.nl (Postfix) with ESMTP id 408AE5F9#9FD021F003; Sun, 25 Apr 2004 00:11:05 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 7E8431CC9B; Sun, 25 Apr 2004 00:11:05 +0200 (CEST) Date: Sun, 25 Apr 2004 00:11:05 +0200 From: Jilles Tjoelker To: Cyrille Lefevre Message-ID: <20040424221105.GA67382@stack.nl> References: <20040422172401.GA88130@stack.nl> <01cb01c428d7$ea7592b0$7890a8c0@dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01cb01c428d7$ea7592b0$7890a8c0@dyndns.org> X-Operating-System: FreeBSD 5.2.1-RELEASE-p4 i386 User-Agent: Mutt/1.5.6i cc: freebsd-standards@freebsd.org cc: Garance A Drosihn cc: Albert Cahalan Subject: Re: ps enhencements (posix syntax, and more) 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, 24 Apr 2004 22:11:07 -0000 On Fri, Apr 23, 2004 at 04:07:49AM +0200, Cyrille Lefevre wrote: > "Jilles Tjoelker" wrote: > > On Thu, Apr 22, 2004 at 12:54:51AM +0200, Cyrille Lefevre wrote: > > Quoting from the pr: > > > enhancements to the posix syntax are : > > > -O same as -o pid,fmtlist,tty,time,comm > [snip] What bothered me was that that -O didn't seem to take any arguments, but that's a mistake in that list only :) > > > findvar() rewritten to handle header specification on aliases. > > > now, you may say "ps -O acflg=XXX" as well as "ps -O acfalg=XXX" > > There's a PR of mine open on that, too (much simpler). > your implementation isn't recursive, so -o RUSAGE could'nt be handled. I told you that my implementation was much simpler :) > > > tsid added in -j format string > > Use sid instead, it's more informative (in case of processes that can't > > access their ctty anymore (like 'p2-') or don't have a ctty at all). I > > think I had a PR for that, too (certainly a local patch, at least). > you are right, I forgot to say that sid as also been added, as well as > tpgid and tsid, but only if -Q (or -W extended in the future) is given. > maybe sid should be added to the default format string (w/o -Q) ? > # bps -jQ > USER PID PPID PGID SID TPGID TSID JOBC STAT TT TIME COMMAND No, just keep USER PID PPID PGID SID JOBC STAT TT TIME COMMAND The interesting thing about TSID is whether it's equal to SID or not, but that information is given by the presence of a '-' after TT already. TPGID might be useful. > > > if (!S_ISCHR(sb.st_mode)) { > > Use isatty(3) for checking whether it's a tty. Things like ps -t > > /dev/da0s1a are meaningless but I think your patch will not reject it. > isatty(3) needs a file descriptor. do you intend that each -t args with an > absolute path would have to be opened, checked w/ isatty(2), then close ? > why not, any other opinion ? Doh! Of course you shouldn't open the tty. And the check you use is the same as in earlier versions of FreeBSD ps. Never mind. -- Jilles Tjoelker