Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2004 00:11:05 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Cyrille Lefevre <root@gits.dyndns.org>
Cc:        Albert Cahalan <albert@users.sourceforge.net>
Subject:   Re: ps enhencements (posix syntax, and more)
Message-ID:  <20040424221105.GA67382@stack.nl>
In-Reply-To: <01cb01c428d7$ea7592b0$7890a8c0@dyndns.org>
References:  <20040422172401.GA88130@stack.nl> <01cb01c428d7$ea7592b0$7890a8c0@dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 23, 2004 at 04:07:49AM +0200, Cyrille Lefevre wrote:
> "Jilles Tjoelker" <jilles@stack.nl> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040424221105.GA67382>