From owner-freebsd-standards@FreeBSD.ORG Mon Apr 26 11:01: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 1EE8016A4DB for ; Mon, 26 Apr 2004 11:01:33 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03A4643D58 for ; Mon, 26 Apr 2004 11:01:33 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i3QI1WMr045473 for ; Mon, 26 Apr 2004 11:01:32 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i3QI1WLF045467 for freebsd-standards@freebsd.org; Mon, 26 Apr 2004 11:01:32 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 26 Apr 2004 11:01:32 -0700 (PDT) Message-Id: <200404261801.i3QI1WLF045467@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, 26 Apr 2004 18:01:33 -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/03/12] standards/64173standards C99 requires some macros to be c 28 problems total. From owner-freebsd-standards@FreeBSD.ORG Tue Apr 27 01:34:40 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 0534116A4CE for ; Tue, 27 Apr 2004 01:34:40 -0700 (PDT) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7205843D69 for ; Tue, 27 Apr 2004 01:34:39 -0700 (PDT) (envelope-from clefevre-lists@9online.fr) Received: from pc2k (202-60-118-80.kaptech.net [80.118.60.202]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id AB06C9BE4F for ; Tue, 27 Apr 2004 10:35:46 +0200 (CEST) Message-ID: <00a501c42c32$7986a270$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: References: <019601c426b0$77dc91a0$7890a8c0@dyndns.org> <1082504719.3444.534.camel@cube><00ba01c427f3$b3477f40$7890a8c0@dyndns.org > <20040422172401.GA88130@stack.nl> <01cb01c428d7$ea7592b0$7890a8c0@dyndns.org> <02d601c42a4d$9d1cb850$7890a8c0@dyndns.org> <00b301c42b09$7ae9cfe0$7890a8c0@dyndns.org> Date: Tue, 27 Apr 2004 10:33:54 +0200 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.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 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: Tue, 27 Apr 2004 08:34:40 -0000 repost to -standard due to rbl, not CC'ed Albert Cahalan ; Jilles Tjoelker ; Garance A Drosihn "Garance A Drosihn" wrote: > At 4:07 AM +0200 4/23/04, Cyrille Lefevre wrote: > > > > > > Format string which contains both an equal sign and a comma > > > > are considered to be comma only separated list. so, both > > > > -o "pid=process id,ppid=parent pid,command=command line" and > > > > -o "pid=child ppid=parent command=command" are well parsed, > >> > unfortunately, mixing "user=user name,pid=pid command" isn't... > >> > > > Hmm, FreeBSD 5.x follows the spec exactly in this respect, > > > an equal sign marks the rest of the argument as header > > > text, so I doubt whether it's worth doing this. Note that > > > FreeBSD 4.x aborts header texts at a comma or space. > > > >any other opinion ? > > "In my opinion": > > Each variable has a default header. The default header > can be overridden by appending an equals sign and the > new text of the header. The rest of the characters in > the argument shall be used as the header text. > > That is a quote from SUSv3. I believe 5.x presently tries > to follow that, and that is what I think it should do. As > to 4.x, the only reason 4.x still behaves the way it does is > that I avoided MFC-ing any commits which would *alter* the > behavior of how something worked in `ps'. The only things I > MFC-ed were commits that cleaned up the code, or which added > new features. will be fixed in the next patch set using #if. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Tue Apr 27 01:34:41 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 465F016A4CE for ; Tue, 27 Apr 2004 01:34:41 -0700 (PDT) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B29843D5E for ; Tue, 27 Apr 2004 01:34:40 -0700 (PDT) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (202-60-118-80.kaptech.net [80.118.60.202]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id 754839BE41 for ; Tue, 27 Apr 2004 10:35:48 +0200 (CEST) Message-ID: <00a601c42c32$7a96b2e0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: References: <019601c426b0$77dc91a0$7890a8c0@dyndns.org><1082504719.3444.534.camel@cube><00ba01c427f3$b3477f40$7890a8c0@dyndns.org> <1082588650.3450.628.camel@cube> <01b401c428d1$27f77060$7890a8c0@dyndns.org> <00d201c42b0a$01737e30$7890a8c0@dyndns.org> Date: Tue, 27 Apr 2004 10:34:32 +0200 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.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 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: Tue, 27 Apr 2004 08:34:41 -0000 repost to -standard due to rbl, not CC'ed Garance A Drosihn ; Albert Cahalan "Albert Cahalan" wrote: PS : Albert, do you have another email address, since sf.net reject all my email bcoz my ISP is often RBL blacklisted :( > On Wed, 2004-04-21 at 18:54, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > On Tue, 2004-04-20 at 13:58, Garance A Drosihn wrote: > > > > At 10:21 AM +0200 4/20/04, Cyrille Lefevre wrote: > > > > >I've finished to cleanup my code and to merge recent changes > > > > >made by Garance. I've get rid of my -X feature for now, and > > > > >replaced it with -q (posix mode) and -Q (sunos/tru64 compat > > > > >mode, aka the return of -g which means -a w/o process group > > > > >leaders, and sizes displayed in KGM format). > > > > > > Having a "-q" for posix mode is kind of pointless, no? > > > The same goes for "-Q". > > > > -X has been recently taken. > > > > free letters, are : BDEFIJKQRVWYbukq, well K and k are reserved > > for future use... so, why now -qQ ? do you have any better suggestion ? > > No, the point was that adding **any** option to switch > parser modes kind of defeats the whole idea of trying > to be compatible with anything. as suggested by Garrett Wollman, I will change -qQ to -W something, as done before through -X posix,etc. which have been retired from the current version. > You can switch via $PATH and/or some other environment variable. currently, mode switch is also done through the basename (posix if the basename contains x, and extended if the basename begins w/ an s) and using an environment variable (see another email about that). but, some others dislike environment variables... > > > I re-align columns as I can. If VSZ overflows while > > > there is some room in the TTY column, the spaces get > > > grabbed up in order to keep other columns aligned. > > > This works well. > > > > the tru64 alternative is not so bad, you know that the size > > will not be greater than 7 chars (999.95M). for instance, > > This is painful for scripts parsing ps output. so, the feature to switch between normal and extended mode is good :) when -W something will be reimplemented, I will change extended to sunos and/or tru64 as done originally. so, you'll be able to use -g without tru64 size display. IMHO, "sunos" compat mode would have to be the default bsd mode as most of older bsd does. > > the fixed size is, 5, which is too less IMHO, but 6 or 7 will > > be to much. however, this suffice in 95% of cases. > > under BSD, there is no room in tty ! > > You usually have room in STAT or TIME. if time dynamic sizing is implemented. but for instance, it isn't. stats as not so much room in it (currently, 1 chars at most) > > > > (-K) don't show kernel thread (option taken from openbsd -k, > > > > *not implemented yet*). forget what I said here, I'm totally wrong (see another post about that) OpenBSd -k is FreeBSD -H. sorry for the mistake. > > > > -g pgidlist select processes by process group id(s). > > > > > > If the PGID list contains non-numeric entries, then you > > > should parse it as a list of effective group names and IDs. > > > > s/should/could/ > > > > as a general rule, I tend to follow what other "standard" systems > > does. by "standard", I mean, *bsd, susv3, hpux, irix, solaris and tru64. > > OK, don't admit that Linux has become the standard now. not yet ;P GNU/Linux systems tries to follow what other systems do, but often do it differently. let's try ifconfig -a, etc. the output is really different from most systems, but it's OOT. > (You're dying, remember?) Also, you forgot AIX and DYNIX/pts. don't have AIX nor DYNIX/pts for testing. > Just look at how neatly -g matches up with -U, -u, and -G. > Not that I entirely made this up though: I remember once > finding an OS that only used -g for effective groups. > > > this also works pretty well and does not need C code editing :) > > > > * internal format syntax: > > * keyword[:flags in reverse polish notation][=header] > > * reverse polish notation: > > * x by itself, * means any, x! means not x, > > * xy| means x | y, xy& means x & y, xy^ means x ^ y. > > * [xyz] is a more compact and readable form of xy|z| > > * [a-z] isn't supported and is understood as a-|z| > > * () may be used for readability but are no-op. > > * bsd flags: d12jlsuv, bsd modifiers: nZ > > * posix flags: d12fjl, posix modifiers: cMPy > > * both modifiers: X if extended. > > > > static char bsd_fmtstr[] = "\ > > label:Z user:[ju](n!)& uid:([ju]n&)([ls]([ju]!)&)| pid:2! ppid:[jl] \ > > pgid:j sid:jX& tpgid:jX& tsid:jX& jobc:j sig:s sigmask:s sigignore:s \ > > sigcatch:s cpu:l pri:l nice:l %cpu:u %mem:u vsz:[lu] rss:[lu] \ > > mwchan:l(n!)& nwchan:ln& tt:[d2u](vX&)| state:1! tt:[jls]([du]!)& \ > > start:u time:1! sl:v re:v pagein:v vsz:v([lu]!)& rss:v([lu]!)& lim:v \ > > tsiz:v %cpu:v(u!)& %mem:v(u!)& command:1! \ > > "; > > I am reminded of sendmail. You're getting close. maybe, but this kept the code as small as possible. encode this using if else if etc. and the code will be at least twice the actual one. > > > will make transition to a mixed POSIX/BSD parser much > > > more difficult, because you won't be able to fall back > > > to a pure BSD parser when "ps -ax" is seen. > > > > in the actual code, the syntax aren't mixed at all. so, no > > transition is needed (except if options aren't preceded > > by a dash which means goes in bsd syntax). the syntax > > selection is based on the program name, and eventually, > > on an environment variable, if compiled in, > > As a primary mechanism, this makes sense. What about when > you hit an error? You could add/remove the "-" and re-exec > (once at most!) to get a second chance at doing what the > user wanted. > > > > > size alias to sz [just for convenience] > > > > > > Nope. This is the size of your swappable image. > > > That would be dirty pages in RAM plus pages in > > > swap, plus anything else (page tables?) that you > > > could swap out. Origins may involve Novell or SCO. > > > > well, yes, originally implemented as : > > > > void > > size(KINFO *k, VARENT *ve) > > { > > VAR *v; > > > > v = ve->var; > > (void)printsize(wlufmt, v->width, > > ps_pgtok((u_long)k->ki_p->ki_dsize) + > > ps_pgtok((u_long)k->ki_p->ki_ssize)); > > } > > > > but, here also, there is no consescus between all flavor > > of unices. hpux and irix says it's dsize+ssize+tsize, sunos > > says (as I remember me) it's dsize+ssize, tru64 says sz > > is rss, while solaris says it's osz (aka vsz in pages). > > since the dsiz and ssiz keywords where added, I prefered > > to say that sz (alias size) is an alias to vsz since rss is also > > displayed w/ -y. > > This all makes sense for: sz, vsz, osz, rss > BTW, you forgot Tru64 rssize. It's rss with an RSS header. right, as currently implemented :) > If you don't implement "size" as being the amount of > stuff that could end up in swap, then there isn't any > format specifier that covers that. any other opinion ? > The POSIX spec has a strange distinction between SZ and vsz. > Observe: [snip] > Damn that spec is vile. well, that's not help. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Tue Apr 27 01:44: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 E41DD16A4CE for ; Tue, 27 Apr 2004 01:44:23 -0700 (PDT) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C06943D53 for ; Tue, 27 Apr 2004 01:44:23 -0700 (PDT) (envelope-from clefevre-lists@9online.fr) Received: from pc2k (202-60-118-80.kaptech.net [80.118.60.202]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id DB1199BE6C for ; Tue, 27 Apr 2004 10:45:25 +0200 (CEST) Message-ID: <012f01c42c33$d2c16360$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: References: <019601c426b0$77dc91a0$7890a8c0@dyndns.org><1082504719.3444.534.camel@cube><00ba01c427f3$b3477f40$7890a8c0@dyndns.org> <1082588650.3450.628.camel@cube> <01b401c428d1$27f77060$7890a8c0@dyndns.org> Date: Tue, 27 Apr 2004 10:44:15 +0200 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.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 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: Tue, 27 Apr 2004 08:44:24 -0000 repost to -standard due to rbl, not CC'ed Albert Cahalan ; Garance A Drosihn "Albert Cahalan" wrote: PS : Albert, do you have another email address, since sf.net reject all my email bcoz my ISP is often RBL blacklisted :( > On Wed, 2004-04-21 at 18:54, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > On Tue, 2004-04-20 at 13:58, Garance A Drosihn wrote: > > > > At 10:21 AM +0200 4/20/04, Cyrille Lefevre wrote: > > > > >I've finished to cleanup my code and to merge recent changes > > > > >made by Garance. I've get rid of my -X feature for now, and > > > > >replaced it with -q (posix mode) and -Q (sunos/tru64 compat > > > > >mode, aka the return of -g which means -a w/o process group > > > > >leaders, and sizes displayed in KGM format). > > > > > > Having a "-q" for posix mode is kind of pointless, no? > > > The same goes for "-Q". > > > > -X has been recently taken. > > > > free letters, are : BDEFIJKQRVWYbukq, well K and k are reserved > > for future use... so, why now -qQ ? do you have any better suggestion ? > > No, the point was that adding **any** option to switch > parser modes kind of defeats the whole idea of trying > to be compatible with anything. as suggested by Garrett Wollman, I will change -qQ to -W something, as done before through -X posix,etc. which have been retired from the current version. > You can switch via $PATH and/or some other environment variable. currently, mode switch is also done through the basename (posix if the basename contains x, and extended if the basename begins w/ an s) and using an environment variable (see another email about that). but, some others dislike environment variables... > > > I re-align columns as I can. If VSZ overflows while > > > there is some room in the TTY column, the spaces get > > > grabbed up in order to keep other columns aligned. > > > This works well. > > > > the tru64 alternative is not so bad, you know that the size > > will not be greater than 7 chars (999.95M). for instance, > > This is painful for scripts parsing ps output. so, the feature to switch between normal and extended mode is good :) when -W something will be reimplemented, I will change extended to sunos and/or tru64 as done originally. so, you'll be able to use -g without tru64 size display. IMHO, "sunos" compat mode would have to be the default bsd mode as most of older bsd does. > > the fixed size is, 5, which is too less IMHO, but 6 or 7 will > > be to much. however, this suffice in 95% of cases. > > under BSD, there is no room in tty ! > > You usually have room in STAT or TIME. if time dynamic sizing is implemented. but for instance, it isn't. stats as not so much room in it (currently, 1 chars at most) > > > > (-K) don't show kernel thread (option taken from openbsd -k, > > > > *not implemented yet*). forget what I said here, I'm totally wrong (see another post about that) OpenBSd -k is FreeBSD -H. sorry for the mistake. > > > > -g pgidlist select processes by process group id(s). > > > > > > If the PGID list contains non-numeric entries, then you > > > should parse it as a list of effective group names and IDs. > > > > s/should/could/ > > > > as a general rule, I tend to follow what other "standard" systems > > does. by "standard", I mean, *bsd, susv3, hpux, irix, solaris and tru64. > > OK, don't admit that Linux has become the standard now. not yet ;P GNU/Linux systems tries to follow what other systems do, but often do it differently. let's try ifconfig -a, etc. the output is really different from most systems, but it's OOT. > (You're dying, remember?) Also, you forgot AIX and DYNIX/pts. don't have AIX nor DYNIX/pts for testing. > Just look at how neatly -g matches up with -U, -u, and -G. > Not that I entirely made this up though: I remember once > finding an OS that only used -g for effective groups. > > > this also works pretty well and does not need C code editing :) > > > > * internal format syntax: > > * keyword[:flags in reverse polish notation][=header] > > * reverse polish notation: > > * x by itself, * means any, x! means not x, > > * xy| means x | y, xy& means x & y, xy^ means x ^ y. > > * [xyz] is a more compact and readable form of xy|z| > > * [a-z] isn't supported and is understood as a-|z| > > * () may be used for readability but are no-op. > > * bsd flags: d12jlsuv, bsd modifiers: nZ > > * posix flags: d12fjl, posix modifiers: cMPy > > * both modifiers: X if extended. > > > > static char bsd_fmtstr[] = "\ > > label:Z user:[ju](n!)& uid:([ju]n&)([ls]([ju]!)&)| pid:2! ppid:[jl] \ > > pgid:j sid:jX& tpgid:jX& tsid:jX& jobc:j sig:s sigmask:s sigignore:s \ > > sigcatch:s cpu:l pri:l nice:l %cpu:u %mem:u vsz:[lu] rss:[lu] \ > > mwchan:l(n!)& nwchan:ln& tt:[d2u](vX&)| state:1! tt:[jls]([du]!)& \ > > start:u time:1! sl:v re:v pagein:v vsz:v([lu]!)& rss:v([lu]!)& lim:v \ > > tsiz:v %cpu:v(u!)& %mem:v(u!)& command:1! \ > > "; > > I am reminded of sendmail. You're getting close. maybe, but this kept the code as small as possible. encode this using if else if etc. and the code will be at least twice the actual one. > > > will make transition to a mixed POSIX/BSD parser much > > > more difficult, because you won't be able to fall back > > > to a pure BSD parser when "ps -ax" is seen. > > > > in the actual code, the syntax aren't mixed at all. so, no > > transition is needed (except if options aren't preceded > > by a dash which means goes in bsd syntax). the syntax > > selection is based on the program name, and eventually, > > on an environment variable, if compiled in, > > As a primary mechanism, this makes sense. What about when > you hit an error? You could add/remove the "-" and re-exec > (once at most!) to get a second chance at doing what the > user wanted. > > > > > size alias to sz [just for convenience] > > > > > > Nope. This is the size of your swappable image. > > > That would be dirty pages in RAM plus pages in > > > swap, plus anything else (page tables?) that you > > > could swap out. Origins may involve Novell or SCO. > > > > well, yes, originally implemented as : > > > > void > > size(KINFO *k, VARENT *ve) > > { > > VAR *v; > > > > v = ve->var; > > (void)printsize(wlufmt, v->width, > > ps_pgtok((u_long)k->ki_p->ki_dsize) + > > ps_pgtok((u_long)k->ki_p->ki_ssize)); > > } > > > > but, here also, there is no consescus between all flavor > > of unices. hpux and irix says it's dsize+ssize+tsize, sunos > > says (as I remember me) it's dsize+ssize, tru64 says sz > > is rss, while solaris says it's osz (aka vsz in pages). > > since the dsiz and ssiz keywords where added, I prefered > > to say that sz (alias size) is an alias to vsz since rss is also > > displayed w/ -y. > > This all makes sense for: sz, vsz, osz, rss > BTW, you forgot Tru64 rssize. It's rss with an RSS header. right, as currently implemented :) > If you don't implement "size" as being the amount of > stuff that could end up in swap, then there isn't any > format specifier that covers that. any other opinion ? > The POSIX spec has a strange distinction between SZ and vsz. > Observe: [snip] > Damn that spec is vile. well, that's not help. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Tue Apr 27 03:06: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 8919516A4CE for ; Tue, 27 Apr 2004 03:06:02 -0700 (PDT) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4D0643D67 for ; Tue, 27 Apr 2004 03:06:01 -0700 (PDT) (envelope-from cyrille.lefevre@laposte.net) Received: from mail.gits.dyndns.org (unknown [81.185.160.114]) by huva.hittite.isp.9tel.net (Postfix) with ESMTP id 0FCF19BFE4 for ; Tue, 27 Apr 2004 12:06:44 +0200 (CEST) Received: from gits.gits.fr.invalid (localhost [127.0.0.1]) i3RA3Pim077854 for ; Tue, 27 Apr 2004 12:05:15 +0200 (CEST) (envelope-from cyrille.lefevre@laposte.net) Received: by gits.gits.fr.invalid (tmda-sendmail, from uid 0); Tue, 27 Apr 2004 12:03:16 +0200 (CEST) Date: Tue, 27 Apr 2004 12:03:07 +0200 To: freebsd standards Message-ID: <20040427100307.GA25392@gits.dyndns.org> References: <019601c426b0$77dc91a0$7890a8c0@dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <019601c426b0$77dc91a0$7890a8c0@dyndns.org> Organization: ACME X-Face: V|+c; 4!|B?E%BE^{E6); aI.[< Mail-Followup-To: cyrille.lefevre@laposte.net, freebsd-standards@FreeBSD.org, drosih@rpi.edu, albert@users.sourceforge.net, acahalan@cs.uml.edu X-Delivery-Agent: TMDA/0.88 (Decidedly) X-Spam-Status: No, hits=-100 required=5 tests=USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.38 cc: Albert Cahalan 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: Tue, 27 Apr 2004 10:06:02 -0000 here is a description of the last PR#64803 updates : *** the kernel part has been reworked and validated in the last patch set. the original PR describe OpenBSD -k as don't show kernel threads, which is wrong, OpenBSD -K is FreeBSD -H except that system processes aren't displayed by default while they are under FreeBSD. added features : -t '?' to select process not attached to a terminal (from older bsd). tsid added in -j format string if -Q. at last, implement KERN_PROC_SESSION in /sys/kern/kern_proc.c as well as system processes filtering in KERN_PROC_PROC (not sure about that). both features have not been tested yet, but will be soon. bugs : ttys are udev_t, not dev_t (this prevented the -t '?' to work). pscomp() getpcpu * 100 or always 0. also, uses typed variables instead of an integer generic one which is more cleaner. *** this patch set may be ignored as integrated in the last patch set. added feature : don't show kernel threads by default unless -H is given. (until this is implemented in the kernel) bug fix : -L is missing a break. *** this is the last patch set before dynamic sizing... this patch set augment the previous ones except the libkvm and kernel part which are fresh patches. files impacted : src/sys/conf/options cvs diff against -current src/sys/sys/sysctl.h cvs diff against -current src/sys/sys/user.h cvs diff against -current src/sys/kern/kern_proc.c cvs diff against -current src/lib/libkvm/Makefile cvs diff against -current src/lib/libkvm/kvm_proc.c cvs diff against -current src/bin/ps/Makefile cvs diff against -current (forgot to save it before any mods) src/bin/ps/keyword.c diff against previous src/bin/ps/ps.c diff against previous kernel level added features : KERN_PROC_SESSION, KERN_PROC_GID and KERN_PROC_RGID have been implemented at kernel level as well as KERN_PROC_TTY_NODEV and KERN_PROC_TTY_REVOKED (the last two are based on what NetBSD does but differently since we have to lock p_session). all these old/new sysctls may be turned on separately using kernel config options as well as the ki_* added keywords. KERN_PROC_PROC now handles KERN_PROC_INC_THREADS and, in this case, is similar to KERN_PROC_ALL. P_SYSTEM processes aren't selected by default (as OpenBSD). PS : take care about the struct kinfo alignment. as currently implemented, ki_spare has been validated under i386 and ia64 (and should work under alpha, sparc64 and amd64), but not validated under alpha (don't have :(. user level added features : -t- to select processes which have been revoked from their terminal device (from NetBSD and probably older bsd -- not verified), at kernel level only. -G may now uses KERN_PROC_RGID if WITH_RGID is defined. -s may now uses KERN_PROC_SESSION if WITH_SESSION is defined. uses KERN_PROC_PROC alone if WITH_THREADS (KERN_PROC_ALL isn't needed anymore). P_SYSTEM processes aren't selected by default if WITHOUT_SYSTEM is defined (well, this is also implemented at kernel level, but for KERN_PROC_PROC only, IMHO, this have to be implemented as a generic filter out before the big case). user level modifications : -t? may be compiled with or without kernel support if WITH_TTY is defined, but -t- can't. some int variables have been changed to size_t (list->count, prtheader, i, lineno, nkept, nselectors). -j now have sid by default. user level bug fixes : kvm_getprocs() error message fixed the way done in -current ps. -o parsing has been reworked to conform to posix (the relaxed form has been WITH_RELAXED_FORMLAT #if'ed). -tco have to use /dev/consolectl instead of /dev/console. "0" (zero) flag has been added to *_fmtstr to better handle -Z (bsd) or -M (posix), so, label is always placed first. -L was missing a break. -u (posix) was filtering on real-uid instead of effective-uid. the current size of ps is (optimized and stripped and w/o extra aliases) : -current : 30788 this one : 38776 PS : Garance, if you want a fresh patch set, let me know. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-standards@FreeBSD.ORG Thu Apr 29 13:33:20 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 E87C616A4CE for ; Thu, 29 Apr 2004 13:33:20 -0700 (PDT) Received: from bgezal.rise.tuwien.ac.at (bgezal.rise.tuwien.ac.at [128.130.59.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 063F843D49 for ; Thu, 29 Apr 2004 13:33:20 -0700 (PDT) (envelope-from stefan@fafoe.narf.at) Received: from fafoe.narf.at (unknown [212.186.3.235]) by bgezal.rise.tuwien.ac.at (Postfix) with ESMTP id 9A1E820A8 for ; Thu, 29 Apr 2004 22:33:18 +0200 (CEST) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 792C2414D for ; Thu, 29 Apr 2004 22:33:08 +0200 (CEST) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id E84E93B5; Thu, 29 Apr 2004 22:33:05 +0200 (CEST) Date: Thu, 29 Apr 2004 22:33:05 +0200 From: Stefan Farfeleder To: freebsd-standards@FreeBSD.org Message-ID: <20040429203303.GH691@wombat.fafoe.narf.at> Mail-Followup-To: freebsd-standards@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nmemrqcdn5VTmUEE" Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: 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, 29 Apr 2004 20:33:21 -0000 --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, here's an implementation of the C99 header . The macros cimag, cimagf, creal and crealf are currently conflicting with the ones from . Cheers, Stefan --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tgmath.h" /*- * Copyright (c) 2004 Stefan Farfeleder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _TGMATH_H_ #define _TGMATH_H_ #include #include extern double __tg_d; extern long double __tg_ld; extern complex float __tg_cf; extern complex double __tg_cd; extern complex long double __tg_cld; /* * We require three magic predicates to be available. * * - __tg_same_type(exp1, exp2) returns 1 if the expressions exp1 and exp2 * have the same type, 0 otherwise. Neither expression shall be evaluated. * - __tg_integer_type(exp) returns 1 if the expression exp has integer type, * 0 otherwise. exp shall not be evaluated. * - __tg_cond_expr(c, exp1, exp2) returns exp1 if c evaluates to * non-zero, exp2 otherwise. Note that exp1's and exp2's types must not * be converted (like ?: does). */ #ifdef __GNUC__ #define __tg_same_type(e1, e2) \ __builtin_types_compatible_p(__typeof__(e1), __typeof__(e2)) #define __tg_integer_type(e) ((__typeof__(e))1.5 == 1) #define __tg_cond_expr(c, e1, e2) __builtin_choose_expr(c, e1, e2) #else #error "need compiler support for __tg_same_type(), __tg_integer_type() and __tg_cond_expr()" #endif #define __tg_use_long(x) \ (__tg_same_type(x, __tg_ld) || __tg_same_type(x, __tg_cld)) #define __tg_use_long2(x, y) (__tg_use_long(x) || __tg_use_long(y)) #define __tg_use_double(x) \ (__tg_same_type(x, __tg_d) || __tg_same_type(x, __tg_cd) || \ __tg_integer_type(x)) #define __tg_use_double2(x, y) (__tg_use_double(x) || __tg_use_double(y)) #define __tg_use_complex(x) \ (__tg_same_type(x, __tg_cf) || __tg_same_type(x, __tg_cd) || \ __tg_same_type(x, __tg_cld)) #define __tg_fnv(x, fn, ...) \ __tg_cond_expr(__tg_use_long(x), fn##l(__VA_ARGS__), \ __tg_cond_expr(__tg_use_double(x), fn(__VA_ARGS__), \ fn##f(__VA_ARGS__))) #define __tg_fn(x, fn) __tg_fnv(x, fn, x) #define __tg_fn2v(x, y, fn, ...) \ __tg_cond_expr(__tg_use_long2(x, y), fn##l(__VA_ARGS__), \ __tg_cond_expr(__tg_use_double2(x, y), fn(__VA_ARGS__), \ fn##f(__VA_ARGS__))) #define __tg_fn2(x, y, fn) __tg_fn2v(x, y, fn, x, y) #define __tg_fn3(x, y, z, fn) \ __tg_cond_expr(__tg_use_long2(x, y) || __tg_use_long(z), \ fn##l(x, y, z), __tg_cond_expr(__tg_use_double2(x, y) || \ __tg_use_double(z), fn(x, y, z), fn##f(x, y, z))) #define __tg_fn_both(x, fn) \ __tg_cond_expr(__tg_use_complex(x), __tg_fn(x, c##fn), __tg_fn(x, fn)) #define __tg_fn_both2(x, y, fn) \ __tg_cond_expr(__tg_use_complex(x) || __tg_use_complex(y), \ __tg_fn2(x, y, c##fn), __tg_fn2(x, y, fn)) /* 7.22#4 */ #define acos(x) __tg_fn_both(x, acos) #define asin(x) __tg_fn_both(x, asin) #define atan(x) __tg_fn_both(x, atan) #define acosh(x) __tg_fn_both(x, acosh) #define asinh(x) __tg_fn_both(x, asinh) #define atanh(x) __tg_fn_both(x, atanh) #define cos(x) __tg_fn_both(x, cos) #define sin(x) __tg_fn_both(x, sin) #define tan(x) __tg_fn_both(x, tan) #define cosh(x) __tg_fn_both(x, cosh) #define sinh(x) __tg_fn_both(x, sinh) #define tanh(x) __tg_fn_both(x, tanh) #define exp(x) __tg_fn_both(x, exp) #define log(x) __tg_fn_both(x, log) #define pow(x, y) __tg_fn_both2(x, y, pow) #define sqrt(x) __tg_fn_both(x, sqrt) /* "The corresponding type-generic macro for fabs and cabs is fabs." */ #define fabs(x) __tg_cond_expr(__tg_use_complex(x), \ __tg_fn(x, cabs), __tg_fn(x, fabs)) /* 7.22#5 */ #define atan2(x, y) __tg_fn2(x, y, atan2) #define cbrt(x) __tg_fn(x, cbrt) #define ceil(x) __tg_fn(x, ceil) #define copysign(x, y) __tg_fn2(x, y, copysign) #define erf(x) __tg_fn(x, erf) #define erfc(x) __tg_fn(x, erfc) #define exp2(x) __tg_fn(x, exp2) #define expm1(x) __tg_fn(x, expm1) #define fdim(x, y) __tg_fn2(x, y, fdim) #define floor(x) __tg_fn(x, floor) #define fma(x, y, z) __tg_fn3(x, y, z, fma) #define fmax(x, y) __tg_fn2(x, y, fmax) #define fmin(x, y) __tg_fn2(x, y, fmin) #define fmod(x, y) __tg_fn2(x, y, fmod) #define frexp(x, y) __tg_fnv(x, frexp, x, y) #define hypot(x, y) __tg_fn2(x, y, hypot) #define ilogb(x) __tg_fn(x, ilogb) #define ldexp(x, y) __tg_fnv(x, ldexp, x, y) #define lgamma(x) __tg_fn(x, lgamma) #define llrint(x) __tg_fn(x, llrint) #define llround(x) __tg_fn(x, llround) #define log10(x) __tg_fn(x, log10) #define log1p(x) __tg_fn(x, log1p) #define log2(x) __tg_fn(x, log2) #define logb(x) __tg_fn(x, logb) #define lrint(x) __tg_fn(x, lrint) #define lround(x) __tg_fn(x, lround) #define nextbyint(x) __tg_fn(x, nextbyint) #define nextafter(x, y) __tg_fn2(x, y, nextafter) #define nexttoward(x, y) __tg_fnv(x, nexttoward, x, y) #define remainder(x, y) __tg_fn2(x, y, remainder) #define remquo(x, y, z) __tg_fn2v(x, y, remquo, x, y, z) #define rint(x) __tg_fn(x, rint) #define round(x) __tg_fn(x, round) #define scalbn(x, y) __tg_fnv(x, scalbn, x, y) #define scalbln(x, y) __tg_fnv(x, scalbln, x, y) #define tgamma(x) __tg_fn(x, tgamma) #define trunc(x) __tg_fn(x, trunc) /* 7.22#6 */ #define carg(x) __tg_fn(x, carg) #define cimag(x) __tg_fn(x, cimag) #define conj(x) __tg_fn(x, conj) #define cproj(x) __tg_fn(x, cproj) #define creal(x) __tg_fn(x, creal) #endif /* !_TGMATH_H_ */ --nmemrqcdn5VTmUEE-- From owner-freebsd-standards@FreeBSD.ORG Thu Apr 29 13:45:27 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 C2ADC16A4CE for ; Thu, 29 Apr 2004 13:45:27 -0700 (PDT) Received: from bgezal.rise.tuwien.ac.at (bgezal.rise.tuwien.ac.at [128.130.59.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C92643D46 for ; Thu, 29 Apr 2004 13:45:27 -0700 (PDT) (envelope-from stefan@fafoe.narf.at) Received: from fafoe.narf.at (unknown [212.186.3.235]) by bgezal.rise.tuwien.ac.at (Postfix) with ESMTP id 9728C20A8 for ; Thu, 29 Apr 2004 22:45:26 +0200 (CEST) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 8CDE9414D for ; Thu, 29 Apr 2004 22:45:18 +0200 (CEST) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 554143B5; Thu, 29 Apr 2004 22:45:16 +0200 (CEST) Date: Thu, 29 Apr 2004 22:45:16 +0200 From: Stefan Farfeleder To: freebsd-standards@FreeBSD.org Message-ID: <20040429204514.GI691@wombat.fafoe.narf.at> Mail-Followup-To: freebsd-standards@FreeBSD.org References: <20040429203303.GH691@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040429203303.GH691@wombat.fafoe.narf.at> User-Agent: Mutt/1.5.6i Subject: Re: 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, 29 Apr 2004 20:45:27 -0000 On Thu, Apr 29, 2004 at 10:33:05PM +0200, Stefan Farfeleder wrote: > The macros > cimag, cimagf, creal and crealf are currently conflicting with the ones > from . Of course only cimag and creal. Stefan