PERFORCE change 49908 for review
Peter Wemm
peter at FreeBSD.org
Mon Mar 29 11:28:01 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=49908
Change 49908 by peter at peter_daintree on 2004/03/29 11:27:44
IFC @49904
Affected files ...
.. //depot/projects/hammer/MAINTAINERS#17 integrate
.. //depot/projects/hammer/bin/ps/print.c#9 integrate
.. //depot/projects/hammer/bin/ps/ps.1#12 integrate
.. //depot/projects/hammer/bin/ps/ps.c#8 integrate
.. //depot/projects/hammer/etc/mtree/BSD.local.dist#18 integrate
.. //depot/projects/hammer/etc/mtree/BSD.usr.dist#22 integrate
.. //depot/projects/hammer/etc/rc.d/mixer#3 integrate
.. //depot/projects/hammer/lib/libc/gen/sysctl.3#5 integrate
.. //depot/projects/hammer/lib/libc/locale/wctype.3#4 integrate
.. //depot/projects/hammer/lib/libc/locale/wctype.c#2 integrate
.. //depot/projects/hammer/lib/libkvm/kvm.3#4 integrate
.. //depot/projects/hammer/lib/libkvm/kvm_open.3#4 integrate
.. //depot/projects/hammer/lib/libkvm/kvm_proc.c#16 integrate
.. //depot/projects/hammer/lib/libthr/thread/Makefile.inc#5 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_cond.c#9 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_create.c#10 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_detach.c#6 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_exit.c#9 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_find_thread.c#3 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_gc.c#7 delete
.. //depot/projects/hammer/lib/libthr/thread/thr_init.c#10 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_join.c#7 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_kern.c#11 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_mattr_kind_np.c#2 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_mutex.c#17 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_private.h#14 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_resume_np.c#4 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_sig.c#7 integrate
.. //depot/projects/hammer/lib/libthr/thread/thr_syscalls.c#4 integrate
.. //depot/projects/hammer/libexec/fingerd/Makefile#2 integrate
.. //depot/projects/hammer/libexec/fingerd/fingerd.c#3 integrate
.. //depot/projects/hammer/release/Makefile#46 integrate
.. //depot/projects/hammer/release/scripts/print-cdrom-packages.sh#17 integrate
.. //depot/projects/hammer/sbin/dmesg/dmesg.8#3 integrate
.. //depot/projects/hammer/sbin/dmesg/dmesg.c#6 integrate
.. //depot/projects/hammer/sbin/growfs/growfs.c#8 integrate
.. //depot/projects/hammer/sbin/idmapd/idmapd.c#4 integrate
.. //depot/projects/hammer/sbin/ipfw/ipfw.8#20 integrate
.. //depot/projects/hammer/sbin/mount/mount.8#10 integrate
.. //depot/projects/hammer/sbin/nologin/Makefile#4 delete
.. //depot/projects/hammer/sbin/nologin/nologin.5#2 delete
.. //depot/projects/hammer/sbin/nologin/nologin.8#4 delete
.. //depot/projects/hammer/sbin/nologin/nologin.c#3 delete
.. //depot/projects/hammer/sbin/tunefs/tunefs.c#6 integrate
.. //depot/projects/hammer/share/colldef/Makefile#12 integrate
.. //depot/projects/hammer/share/man/man4/man4.i386/Makefile#18 integrate
.. //depot/projects/hammer/share/man/man7/hier.7#13 integrate
.. //depot/projects/hammer/share/mklocale/Makefile#11 integrate
.. //depot/projects/hammer/share/mklocale/UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/Makefile#11 integrate
.. //depot/projects/hammer/share/monetdef/be_BY.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/bg_BG.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/cs_CZ.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/en_GB.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/en_IE.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/hy_AM.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/ja_JP.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/kk_KZ.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/ko_KR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/pl_PL.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/ru_RU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/sr_YU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/uk_UA.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/zh_CN.UTF-8.src#1 branch
.. //depot/projects/hammer/share/monetdef/zh_HK.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/Makefile#11 integrate
.. //depot/projects/hammer/share/msgdef/be_BY.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/bg_BG.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/el_GR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/hy_AM.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/ja_JP.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/kk_KZ.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/ru_RU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/sr_YU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/uk_UA.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/zh_CN.UTF-8.src#1 branch
.. //depot/projects/hammer/share/msgdef/zh_TW.UTF-8.src#1 branch
.. //depot/projects/hammer/share/numericdef/Makefile#10 integrate
.. //depot/projects/hammer/share/timedef/Makefile#11 integrate
.. //depot/projects/hammer/share/timedef/be_BY.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/bg_BG.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/ca_ES.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/cs_CZ.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/da_DK.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/de_AT.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/de_DE.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/el_GR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/es_ES.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/et_EE.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/fi_FI.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/fr_FR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/hr_HR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/hu_HU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/hy_AM.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/is_IS.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/it_IT.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/ja_JP.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/kk_KZ.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/ko_KR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/lt_LT.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/no_NO.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/pl_PL.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/pt_BR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/pt_PT.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/ro_RO.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/ru_RU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/sk_SK.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/sl_SI.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/sr_YU.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/sv_SE.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/tr_TR.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/uk_UA.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/zh_CN.UTF-8.src#1 branch
.. //depot/projects/hammer/share/timedef/zh_TW.UTF-8.src#1 branch
.. //depot/projects/hammer/sys/alpha/alpha/vm_machdep.c#14 integrate
.. //depot/projects/hammer/sys/alpha/linux/linux_dummy.c#4 integrate
.. //depot/projects/hammer/sys/alpha/linux/linux_proto.h#7 integrate
.. //depot/projects/hammer/sys/alpha/linux/linux_syscall.h#7 integrate
.. //depot/projects/hammer/sys/alpha/linux/linux_sysent.c#7 integrate
.. //depot/projects/hammer/sys/alpha/linux/syscalls.master#7 integrate
.. //depot/projects/hammer/sys/amd64/amd64/identcpu.c#25 integrate
.. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#34 integrate
.. //depot/projects/hammer/sys/amd64/conf/GENERIC#34 integrate
.. //depot/projects/hammer/sys/boot/alpha/common/conf.c#4 integrate
.. //depot/projects/hammer/sys/boot/i386/boot0/boot0ext.s#1 branch
.. //depot/projects/hammer/sys/boot/i386/boot0ext/Makefile#1 branch
.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_proto.h#11 integrate
.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscall.h#11 integrate
.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscalls.c#11 integrate
.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_sysent.c#11 integrate
.. //depot/projects/hammer/sys/compat/freebsd32/syscalls.master#14 integrate
.. //depot/projects/hammer/sys/compat/ndis/kern_ndis.c#12 integrate
.. //depot/projects/hammer/sys/compat/ndis/ndis_var.h#8 integrate
.. //depot/projects/hammer/sys/compat/ndis/ntoskrnl_var.h#8 integrate
.. //depot/projects/hammer/sys/compat/ndis/resource_var.h#2 integrate
.. //depot/projects/hammer/sys/compat/ndis/subr_ndis.c#10 integrate
.. //depot/projects/hammer/sys/compat/ndis/subr_ntoskrnl.c#12 integrate
.. //depot/projects/hammer/sys/conf/kern.pre.mk#23 integrate
.. //depot/projects/hammer/sys/contrib/pf/net/pf.c#3 integrate
.. //depot/projects/hammer/sys/contrib/pf/net/pf_ioctl.c#4 integrate
.. //depot/projects/hammer/sys/dev/acpica/acpi.c#28 integrate
.. //depot/projects/hammer/sys/dev/firewire/firewire.c#24 integrate
.. //depot/projects/hammer/sys/dev/firewire/firewire.h#7 integrate
.. //depot/projects/hammer/sys/dev/firewire/firewirereg.h#14 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwcrom.c#7 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwdev.c#12 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwdma.c#6 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwmem.c#13 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwohci.c#22 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwohci_pci.c#22 integrate
.. //depot/projects/hammer/sys/dev/firewire/fwohcivar.h#7 integrate
.. //depot/projects/hammer/sys/dev/firewire/if_fwe.c#16 integrate
.. //depot/projects/hammer/sys/dev/firewire/sbp.c#27 integrate
.. //depot/projects/hammer/sys/dev/firewire/sbp_targ.c#5 integrate
.. //depot/projects/hammer/sys/dev/if_ndis/if_ndis.c#12 integrate
.. //depot/projects/hammer/sys/dev/ips/ips.h#8 integrate
.. //depot/projects/hammer/sys/dev/pccard/pccarddevs#21 integrate
.. //depot/projects/hammer/sys/dev/pccard/pccarddevs.h#21 integrate
.. //depot/projects/hammer/sys/dev/twe/twe.c#7 integrate
.. //depot/projects/hammer/sys/dev/twe/twe_freebsd.c#11 integrate
.. //depot/projects/hammer/sys/dev/twe/twevar.h#5 integrate
.. //depot/projects/hammer/sys/dev/usb/ohci.c#12 integrate
.. //depot/projects/hammer/sys/dev/wi/if_wi_pccard.c#18 integrate
.. //depot/projects/hammer/sys/i386/ibcs2/ibcs2_proto.h#4 integrate
.. //depot/projects/hammer/sys/i386/ibcs2/ibcs2_syscall.h#4 integrate
.. //depot/projects/hammer/sys/i386/ibcs2/ibcs2_sysent.c#5 integrate
.. //depot/projects/hammer/sys/i386/ibcs2/syscalls.master#4 integrate
.. //depot/projects/hammer/sys/i386/linux/linux_dummy.c#5 integrate
.. //depot/projects/hammer/sys/i386/linux/linux_proto.h#10 integrate
.. //depot/projects/hammer/sys/i386/linux/linux_syscall.h#10 integrate
.. //depot/projects/hammer/sys/i386/linux/linux_sysent.c#11 integrate
.. //depot/projects/hammer/sys/i386/linux/syscalls.master#10 integrate
.. //depot/projects/hammer/sys/ia64/ia64/vm_machdep.c#20 integrate
.. //depot/projects/hammer/sys/kern/init_sysent.c#28 integrate
.. //depot/projects/hammer/sys/kern/kern_descrip.c#21 integrate
.. //depot/projects/hammer/sys/kern/kern_thr.c#13 integrate
.. //depot/projects/hammer/sys/kern/kern_umtx.c#11 integrate
.. //depot/projects/hammer/sys/kern/sched_ule.c#27 integrate
.. //depot/projects/hammer/sys/kern/subr_param.c#8 integrate
.. //depot/projects/hammer/sys/kern/subr_smp.c#17 integrate
.. //depot/projects/hammer/sys/kern/sys_pipe.c#19 integrate
.. //depot/projects/hammer/sys/kern/sys_socket.c#8 integrate
.. //depot/projects/hammer/sys/kern/syscalls.c#27 integrate
.. //depot/projects/hammer/sys/kern/syscalls.master#28 integrate
.. //depot/projects/hammer/sys/kern/uipc_domain.c#5 integrate
.. //depot/projects/hammer/sys/kern/uipc_socket.c#18 integrate
.. //depot/projects/hammer/sys/kern/uipc_syscalls.c#19 integrate
.. //depot/projects/hammer/sys/kern/vfs_mount.c#24 integrate
.. //depot/projects/hammer/sys/modules/Makefile#39 integrate
.. //depot/projects/hammer/sys/net/bpfdesc.h#7 integrate
.. //depot/projects/hammer/sys/net/if_tun.c#14 integrate
.. //depot/projects/hammer/sys/netinet/in_pcb.c#20 integrate
.. //depot/projects/hammer/sys/netinet/in_pcb.h#14 integrate
.. //depot/projects/hammer/sys/netinet/ip6.h#5 integrate
.. //depot/projects/hammer/sys/netinet/ip_divert.c#14 integrate
.. //depot/projects/hammer/sys/netinet/ip_input.c#27 integrate
.. //depot/projects/hammer/sys/netinet/ip_output.c#26 integrate
.. //depot/projects/hammer/sys/netinet/raw_ip.c#17 integrate
.. //depot/projects/hammer/sys/netinet/tcp_syncache.c#14 integrate
.. //depot/projects/hammer/sys/netinet/tcp_usrreq.c#11 integrate
.. //depot/projects/hammer/sys/netinet/udp_usrreq.c#15 integrate
.. //depot/projects/hammer/sys/netinet6/in6_pcb.c#13 integrate
.. //depot/projects/hammer/sys/netinet6/in6_pcb.h#5 integrate
.. //depot/projects/hammer/sys/netinet6/in6_src.c#9 integrate
.. //depot/projects/hammer/sys/netinet6/ip6_output.c#20 integrate
.. //depot/projects/hammer/sys/netinet6/raw_ip6.c#11 integrate
.. //depot/projects/hammer/sys/netinet6/udp6_output.c#9 integrate
.. //depot/projects/hammer/sys/netinet6/udp6_usrreq.c#12 integrate
.. //depot/projects/hammer/sys/nfs4client/nfs4_dev.h#2 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs.h#9 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_socket.c#12 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_subs.c#11 integrate
.. //depot/projects/hammer/sys/pc98/conf/NOTES#21 integrate
.. //depot/projects/hammer/sys/pc98/i386/machdep.c#26 integrate
.. //depot/projects/hammer/sys/pc98/pc98/clock.c#12 integrate
.. //depot/projects/hammer/sys/pc98/pc98/fd.c#15 integrate
.. //depot/projects/hammer/sys/rpc/rpcclnt.c#6 integrate
.. //depot/projects/hammer/sys/sparc64/ebus/ebus.c#7 integrate
.. //depot/projects/hammer/sys/sparc64/sbus/sbus.c#10 integrate
.. //depot/projects/hammer/sys/sparc64/sparc64/vm_machdep.c#14 integrate
.. //depot/projects/hammer/sys/sys/mutex.h#11 integrate
.. //depot/projects/hammer/sys/sys/param.h#30 integrate
.. //depot/projects/hammer/sys/sys/pcpu.h#6 integrate
.. //depot/projects/hammer/sys/sys/pipe.h#7 integrate
.. //depot/projects/hammer/sys/sys/proc.h#45 integrate
.. //depot/projects/hammer/sys/sys/smp.h#6 integrate
.. //depot/projects/hammer/sys/sys/syscall.h#27 integrate
.. //depot/projects/hammer/sys/sys/syscall.mk#27 integrate
.. //depot/projects/hammer/sys/sys/sysproto.h#27 integrate
.. //depot/projects/hammer/sys/sys/thr.h#2 integrate
.. //depot/projects/hammer/sys/sys/tree.h#3 integrate
.. //depot/projects/hammer/tools/tools/README#7 integrate
.. //depot/projects/hammer/tools/tools/gdb_regofs/Makefile#1 branch
.. //depot/projects/hammer/tools/tools/gdb_regofs/ia64.c#1 branch
.. //depot/projects/hammer/tools/tools/nanobsd/i386.diskimage#3 integrate
.. //depot/projects/hammer/usr.bin/Makefile#28 integrate
.. //depot/projects/hammer/usr.bin/fstat/fstat.1#3 integrate
.. //depot/projects/hammer/usr.bin/kdump/kdump.c#9 integrate
.. //depot/projects/hammer/usr.bin/killall/killall.1#5 integrate
.. //depot/projects/hammer/usr.bin/netstat/Makefile#4 integrate
.. //depot/projects/hammer/usr.bin/netstat/main.c#7 integrate
.. //depot/projects/hammer/usr.bin/netstat/mcast.c#1 branch
.. //depot/projects/hammer/usr.bin/netstat/netstat.1#7 integrate
.. //depot/projects/hammer/usr.bin/netstat/netstat.h#6 integrate
.. //depot/projects/hammer/usr.bin/pkill/Makefile#1 branch
.. //depot/projects/hammer/usr.bin/pkill/pkill.1#1 branch
.. //depot/projects/hammer/usr.bin/pkill/pkill.c#1 branch
.. //depot/projects/hammer/usr.bin/vmstat/vmstat.8#5 integrate
.. //depot/projects/hammer/usr.bin/vmstat/vmstat.c#13 integrate
.. //depot/projects/hammer/usr.sbin/fdcontrol/Makefile#4 integrate
.. //depot/projects/hammer/usr.sbin/fdformat/Makefile#2 integrate
.. //depot/projects/hammer/usr.sbin/fdread/Makefile#2 integrate
.. //depot/projects/hammer/usr.sbin/fdread/fdutil.c#3 integrate
.. //depot/projects/hammer/usr.sbin/mountd/exports.5#6 integrate
.. //depot/projects/hammer/usr.sbin/pstat/pstat.8#3 integrate
.. //depot/projects/hammer/usr.sbin/pstat/pstat.c#8 integrate
Differences ...
==== //depot/projects/hammer/MAINTAINERS#17 (text+ko) ====
@@ -1,4 +1,4 @@
-$FreeBSD: src/MAINTAINERS,v 1.83 2004/03/23 21:22:24 mlaier Exp $
+$FreeBSD: src/MAINTAINERS,v 1.84 2004/03/25 20:02:17 scottl Exp $
subsystem login notes
-----------------------------
@@ -31,7 +31,6 @@
mlx scottl Pre-commit review requested.
mly scottl Pre-commit review requested.
maestro3 scottl Pre-commit review requested.
-raidframe scottl Pre-commit review requested.
CAM gibbs,
ken Pre-commit review requested. send to scsi at freebsd.org
devstat(9) ken Pre-commit review requested.
==== //depot/projects/hammer/bin/ps/print.c#9 (text+ko) ====
@@ -38,7 +38,7 @@
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ps/print.c,v 1.83 2003/08/13 07:35:07 harti Exp $");
+__FBSDID("$FreeBSD: src/bin/ps/print.c,v 1.84 2004/03/28 02:13:31 gad Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -653,9 +653,9 @@
struct priority *lpri;
char str[8];
unsigned class, level;
-
+
v = ve->var;
- lpri = (struct priority *) ((char *)k + v->off);
+ lpri = &k->ki_p->ki_pri;
class = lpri->pri_class;
level = lpri->pri_level;
switch (class) {
==== //depot/projects/hammer/bin/ps/ps.1#12 (text+ko) ====
@@ -30,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
-.\" $FreeBSD: src/bin/ps/ps.1,v 1.68 2004/03/21 11:24:06 tjr Exp $
+.\" $FreeBSD: src/bin/ps/ps.1,v 1.72 2004/03/27 18:26:40 gad Exp $
.\"
-.Dd March 21, 2004
+.Dd March 27, 2004
.Dt PS 1
.Os
.Sh NAME
@@ -40,7 +40,11 @@
.Nd process status
.Sh SYNOPSIS
.Nm
-.Op Fl aCcefHhjlmrSTuvwxZ
+.Op Fl aCcefHhjlmrSTuvwXxZ
+.Oo Fl G Ar gid Ns Xo
+.Op , Ns Ar gid Ns No ...
+.Xc
+.Oc
.Op Fl M Ar core
.Op Fl N Ar system
.Op Fl O Ar fmt
@@ -49,7 +53,10 @@
.Op , Ns Ar pid Ns No ...
.Xc
.Oc
-.Op Fl t Ar tty
+.Oo Fl t Ar tty Ns Xo
+.Op , Ns Ar tty Ns No ...
+.Xc
+.Oc
.Oo Fl U Ar username Ns Xo
.Op , Ns Ar username Ns No ...
.Xc
@@ -65,7 +72,19 @@
This information is sorted by controlling terminal, then by process
.Tn ID .
.Pp
-The information displayed is selected based on a set of keywords (see the
+A different set of processes can be selected for display by using any
+combination of the
+.Fl a, G , p , T , t
+and
+.Fl U
+options.
+If more than one of these options are given, then
+.Nm
+will select all processes which are matched by at least one of the
+given options.
+.Pp
+For the processes which have been selected for display, the information
+to display is selected based on a set of keywords (see the
.Fl L
.Fl O
and
@@ -86,6 +105,10 @@
.Bl -tag -width indent
.It Fl a
Display information about other users' processes as well as your own.
+This will skip any processes which do not have a controlling teminal,
+unless the
+.Fl x
+option is also specified.
This can be disabled by setting the
.Va security.bsd.see_other_uids
sysctl to zero.
@@ -101,6 +124,10 @@
.It Fl f
Show commandline and environment information about swapped out processes.
This option is honored only if the uid of the user is 0.
+.It Fl G
+Display information about processes which are running with the specified
+real group
+.Tn ID(s) .
.It Fl H
Show all of the
.Em kernel visible
@@ -121,14 +148,13 @@
and command.
.It Fl M
Extract values associated with the name list from the specified core
-instead of the default
-.Pa /dev/kmem .
+instead of the currently running system.
.It Fl m
Sort by memory usage, instead of by process
.Tn ID .
.It Fl N
-Extract the name list from the specified system instead of the default
-.Pa /boot/kernel/kernel .
+Extract the name list from the specified system instead of the default,
+which is the kernel image the system has booted from.
.It Fl O
Add the information associated with the space or comma separated list
of keywords specified, after the process
@@ -148,7 +174,7 @@
This causes the printed header to use the specified string instead of
the standard header.
.It Fl p
-Display information associated with the specified process
+Display information about processes which match the specified process
.Tn ID(s) .
.It Fl r
Sort by current cpu usage, instead of by process
@@ -161,7 +187,7 @@
with the standard input.
.It Fl t
Display information about processes attached to the specified terminal
-device.
+device(s).
.It Fl U
Display the processes belonging to the specified
.Ar username Ns (s) .
@@ -190,8 +216,22 @@
option is specified more than once,
.Nm
will use as many columns as necessary without regard for your window size.
+.It Fl X
+When displaying processes matched by other options, skip any processes
+which do not have a controlling terminal.
.It Fl x
-Display information about processes without controlling terminals.
+When displaying processes matched by other options, include processes
+which do not have a controlling terminal.
+This is the opposite of the
+.Fl X
+option.
+If both
+.Fl X
+and
+.Fl x
+are specified in the same command, then
+.Nm
+will use the one which was specified last.
.It Fl Z
Add label to the list of keywords for which
.Nm
@@ -522,17 +562,11 @@
attempts to automatically determine the terminal width.
.El
.Sh FILES
-.Bl -tag -width /var/db/kvm_kernel.db -compact
-.It Pa /dev/kmem
-default kernel memory
+.Bl -tag -width ".Pa /boot/kernel/kernel" -compact
.It Pa /dev/lomac
interface used to query the
.Xr lomac 4
KLD
-.It Pa /var/run/dev.db
-/dev name database
-.It Pa /var/db/kvm_kernel.db
-system namelist database
.It Pa /boot/kernel/kernel
default system namelist
.It Pa /proc
@@ -549,6 +583,14 @@
.Xr pstat 8 ,
.Xr sysctl 8 ,
.Xr mutex 9
+.Sh STANDARDS
+For historical reasons,
+.Nm
+utility under
+.Fx
+supports a different set of options from what is described by
+.St -p1003.2 ,
+and what is supported on non-BSD operating systems.
.Sh HISTORY
The
.Nm
==== //depot/projects/hammer/bin/ps/ps.c#8 (text+ko) ====
@@ -29,6 +29,13 @@
* 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.
+ * ------+---------+---------+-------- + --------+---------+---------+---------*
+ * Copyright (c) 2004 - Garance Alistair Drosehn <gad at FreeBSD.org>.
+ * All rights reserved.
+ *
+ * Significant modifications made to bring `ps' options somewhat closer
+ * to the standard for `ps' as described in SingleUnixSpec-v3.
+ * ------+---------+---------+-------- + --------+---------+---------+---------*
*/
#ifndef lint
@@ -44,9 +51,10 @@
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ps/ps.c,v 1.66 2004/03/18 01:28:23 gad Exp $");
+__FBSDID("$FreeBSD: src/bin/ps/ps.c,v 1.80 2004/03/29 03:03:28 gad Exp $");
#include <sys/param.h>
+#include <sys/proc.h>
#include <sys/user.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
@@ -56,11 +64,13 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <grp.h>
#include <kvm.h>
#include <limits.h>
#include <locale.h>
#include <paths.h>
#include <pwd.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -68,77 +78,103 @@
#include "ps.h"
-#define SEP ", \t" /* username separators */
+#define W_SEP " \t" /* "Whitespace" list separators */
+#define T_SEP "," /* "Terminate-element" list separators */
+
+#ifdef LAZY_PS
+#define DEF_UREAD 0
+#define OPT_LAZY_f "f"
+#else
+#define DEF_UREAD 1 /* Always do the more-expensive read. */
+#define OPT_LAZY_f /* I.e., the `-f' option is not added. */
+#endif
+
+int cflag; /* -c */
+int eval; /* Exit value */
+time_t now; /* Current time(3) value */
+int rawcpu; /* -C */
+int sumrusage; /* -S */
+int termwidth; /* Width of the screen (0 == infinity). */
+int totwidth; /* Calculated-width of requested variables. */
-static KINFO *kinfo;
struct varent *vhead;
-int eval; /* exit value */
-int cflag; /* -c */
-int rawcpu; /* -C */
-int sumrusage; /* -S */
-int termwidth; /* width of screen (0 == infinity) */
-int totwidth; /* calculated width of requested variables */
+static int forceuread = DEF_UREAD; /* Do extra work to get u-area. */
+static kvm_t *kd;
+static KINFO *kinfo;
+static int needcomm; /* -o "command" */
+static int needenv; /* -e */
+static int needuser; /* -o "user" */
+static int optfatal; /* Fatal error parsing some list-option. */
-time_t now; /* current time(3) value */
+static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
-static int needuser, needcomm, needenv;
-#if defined(LAZY_PS)
-static int forceuread=0;
-#else
-static int forceuread=1;
-#endif
+struct listinfo;
+typedef int addelem_rtn(struct listinfo *_inf, const char *_elem);
-static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
+struct listinfo {
+ int count;
+ int maxcount;
+ int elemsize;
+ addelem_rtn *addelem;
+ const char *lname;
+ union {
+ gid_t *gids;
+ pid_t *pids;
+ dev_t *ttys;
+ uid_t *uids;
+ void *ptr;
+ };
+};
-static const char *fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int),
+static int addelem_gid(struct listinfo *, const char *);
+static int addelem_pid(struct listinfo *, const char *);
+static int addelem_tty(struct listinfo *, const char *);
+static int addelem_uid(struct listinfo *, const char *);
+static void add_list(struct listinfo *, const char *);
+static void dynsizevars(KINFO *);
+static void *expand_list(struct listinfo *);
+static const char *fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int),
KINFO *, char *, int);
+static void free_list(struct listinfo *);
+static void init_list(struct listinfo *, addelem_rtn, int, const char *);
static char *kludge_oldps_options(char *);
static int pscomp(const void *, const void *);
static void saveuser(KINFO *);
static void scanvars(void);
-static void dynsizevars(KINFO *);
static void sizevars(void);
static void usage(void);
-static pid_t *getpids(const char *, int *);
-static uid_t *getuids(const char *, int *);
static char dfmt[] = "pid,tt,state,time,command";
static char jfmt[] = "user,pid,ppid,pgid,jobc,state,tt,time,command";
-static char lfmt[] = "uid,pid,ppid,cpu,pri,nice,vsz,rss,mwchan,state,tt,time,command";
+static char lfmt[] = "uid,pid,ppid,cpu,pri,nice,vsz,rss,mwchan,state,"
+ "tt,time,command";
static char o1[] = "pid";
static char o2[] = "tt,state,time,command";
static char ufmt[] = "user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command";
-static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,%cpu,%mem,command";
+static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,"
+ "%cpu,%mem,command";
static char Zfmt[] = "label";
-static kvm_t *kd;
-
-#if defined(LAZY_PS)
-#define PS_ARGS "aCcefgHhjLlM:mN:O:o:p:rSTt:U:uvwxZ"
-#else
-#define PS_ARGS "aCcegHhjLlM:mN:O:o:p:rSTt:U:uvwxZ"
-#endif
+#define PS_ARGS "AaCc" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ"
int
main(int argc, char *argv[])
{
+ struct listinfo gidlist, pgrplist, pidlist;
+ struct listinfo ruidlist, sesslist, ttylist, uidlist;
struct kinfo_proc *kp;
struct varent *vent;
struct winsize ws;
- dev_t ttydev;
- pid_t *pids;
- uid_t *uids;
- int all, ch, dropgid, flag, _fmt, i, lineno;
- int nentries, nocludge, noutput, npids, nuids, pid;
- int prtheader, showthreads, uid, wflag, what, xflg;
+ const char *cp, *nlistf, *memf;
char *cols;
+ int all, ch, dropgid, elem, flag, _fmt, i, lineno;
+ int nentries, nocludge, nkept, nselectors;
+ int prtheader, showthreads, wflag, what, xkeep, xkeep_implied;
char errbuf[_POSIX2_LINE_MAX];
- const char *cp, *nlistf, *memf;
(void) setlocale(LC_ALL, "");
- /* Set the time to what it is right now. */
- time(&now);
+ time(&now); /* Used by routines in print.c. */
if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0')
termwidth = atoi(cols);
@@ -170,16 +206,30 @@
argv[1] = kludge_oldps_options(argv[1]);
}
- all = _fmt = prtheader = wflag = xflg = 0;
- npids = nuids = 0;
- pids = uids = NULL;
- ttydev = NODEV;
- dropgid = 0;
+ all = dropgid = _fmt = nselectors = optfatal = 0;
+ prtheader = showthreads = wflag = xkeep_implied = 0;
+ xkeep = -1; /* Neither -x nor -X. */
+ init_list(&gidlist, addelem_gid, sizeof(gid_t), "group");
+ init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group");
+ init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id");
+ init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser");
+ init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
+ init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
+ init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
memf = nlistf = _PATH_DEVNULL;
- showthreads = 0;
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
switch((char)ch) {
+ case 'A':
+ /*
+ * Exactly the same as `-ax'. This has been
+ * added for compatability with SUSv3, but for
+ * now it will not be described in the man page.
+ */
+ nselectors++;
+ all = xkeep = 1;
+ break;
case 'a':
+ nselectors++;
all = 1;
break;
case 'C':
@@ -191,8 +241,32 @@
case 'e': /* XXX set ufmt */
needenv = 1;
break;
+#ifdef LAZY_PS
+ case 'f':
+ if (getuid() == 0 || getgid() == 0)
+ forceuread = 1;
+ break;
+#endif
+ case 'G':
+ add_list(&gidlist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
+ break;
case 'g':
+#if 0
+ /*
+ * XXX - This SUSv3 behavior is still under debate
+ * since it conflicts with the (undocumented)
+ * `-g' option. So we skip it for now.
+ */
+ add_list(&pgrplist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
+ break;
+#else
+ /* The historical BSD-ish (from SunOS) behavior. */
break; /* no-op */
+#endif
case 'H':
showthreads = KERN_PROC_INC_THREAD;
break;
@@ -234,47 +308,63 @@
parsefmt(optarg, 1);
_fmt = 1;
break;
-#if defined(LAZY_PS)
- case 'f':
- if (getuid() == 0 || getgid() == 0)
- forceuread = 1;
+ case 'p':
+ add_list(&pidlist, optarg);
+ /*
+ * Note: `-p' does not *set* xkeep, but any values
+ * from pidlist are checked before xkeep is. That
+ * way they are always matched, even if the user
+ * specifies `-X'.
+ */
+ nselectors++;
+ break;
+#if 0
+ case 'R':
+ /*
+ * XXX - This un-standard option is still under
+ * debate. This is what SUSv3 defines as
+ * the `-U' option, and while it would be
+ * nice to have, it could cause even more
+ * confusion to implement it as `-R'.
+ */
+ add_list(&ruidlist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
break;
#endif
- case 'p':
- pids = getpids(optarg, &npids);
- xflg = 1;
- break;
case 'r':
sortby = SORTCPU;
break;
case 'S':
sumrusage = 1;
break;
+#if 0
+ case 's':
+ /*
+ * XXX - This non-standard option is still under
+ * debate. This *is* supported on Solaris,
+ * Linux, and IRIX, but conflicts with `-s'
+ * on NetBSD and maybe some older BSD's.
+ */
+ add_list(&sesslist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
+ break;
+#endif
case 'T':
if ((optarg = ttyname(STDIN_FILENO)) == NULL)
errx(1, "stdin: not a terminal");
/* FALLTHROUGH */
- case 't': {
- struct stat sb;
- char *ttypath, pathbuf[PATH_MAX];
-
- if (strcmp(optarg, "co") == 0)
- ttypath = strdup(_PATH_CONSOLE);
- else if (*optarg != '/')
- (void)snprintf(ttypath = pathbuf,
- sizeof(pathbuf), "%s%s", _PATH_TTY, optarg);
- else
- ttypath = optarg;
- if (stat(ttypath, &sb) == -1)
- err(1, "%s", ttypath);
- if (!S_ISCHR(sb.st_mode))
- errx(1, "%s: not a terminal", ttypath);
- ttydev = sb.st_rdev;
+ case 't':
+ add_list(&ttylist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
break;
- }
case 'U':
- uids = getuids(optarg, &nuids);
- xflg++; /* XXX: intuitive? */
+ /* This is what SUSv3 defines as the `-u' option. */
+ add_list(&uidlist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
break;
case 'u':
parsefmt(ufmt, 0);
@@ -295,8 +385,22 @@
termwidth = 131;
wflag++;
break;
+ 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':
- xflg = 1;
+ xkeep = 1;
break;
case 'Z':
parsefmt(Zfmt, 0);
@@ -308,14 +412,17 @@
}
argc -= optind;
argv += optind;
+ if (optfatal)
+ exit(1); /* Error messages already printed. */
+ if (xkeep < 0) /* Neither -X nor -x was specified. */
+ xkeep = xkeep_implied;
#define BACKWARD_COMPATIBILITY
#ifdef BACKWARD_COMPATIBILITY
if (*argv) {
nlistf = *argv;
- if (*++argv) {
+ if (*++argv)
memf = *argv;
- }
}
#endif
/*
@@ -334,12 +441,13 @@
if (!_fmt)
parsefmt(dfmt, 0);
- /* XXX - should be cleaner */
- if (!all && ttydev == NODEV && !npids && !nuids) {
- if ((uids = malloc(sizeof (*uids))) == NULL)
+ if (nselectors == 0) {
+ uidlist.ptr = malloc(sizeof(uid_t));
+ if (uidlist.ptr == NULL)
errx(1, "malloc failed");
- nuids = 1;
- *uids = getuid();
+ nselectors = 1;
+ uidlist.count = uidlist.maxcount = 1;
+ *uidlist.uids = getuid();
}
/*
@@ -347,37 +455,130 @@
* and adjusting header widths as appropriate.
*/
scanvars();
+
/*
- * get proc list
+ * Get process list. If the user requested just one selector-
+ * option, then kvm_getprocs can be asked to return just those
+ * processes. Otherwise, have it return all processes, and
+ * then this routine will search that full list and select the
+ * processes which match any of the user's selector-options.
*/
- if (nuids == 1) {
- what = KERN_PROC_UID | showthreads;
- flag = *uids;
- } else if (ttydev != NODEV) {
- what = KERN_PROC_TTY | showthreads;
- flag = ttydev;
- } else if (npids == 1) {
- what = KERN_PROC_PID | showthreads;
- flag = *pids;
- } else {
- what = showthreads != 0 ? KERN_PROC_ALL : KERN_PROC_PROC;
- flag = 0;
+ what = showthreads != 0 ? KERN_PROC_ALL : KERN_PROC_PROC;
+ flag = 0;
+ if (nselectors == 1) {
+ /* XXX - Apparently there's no KERN_PROC_GID flag. */
+ if (pgrplist.count == 1) {
+ what = KERN_PROC_PGRP | showthreads;
+ flag = *pgrplist.pids;
+ nselectors = 0;
+ } else if (pidlist.count == 1) {
+ what = KERN_PROC_PID | showthreads;
+ flag = *pidlist.pids;
+ nselectors = 0;
+ } else if (ruidlist.count == 1) {
+ what = KERN_PROC_RUID | showthreads;
+ flag = *ruidlist.uids;
+ nselectors = 0;
+#if 0
+ /*
+ * XXX - KERN_PROC_SESSION causes error in kvm_getprocs?
+ * For now, always do sid-matching in this routine.
+ */
+ } else if (sesslist.count == 1) {
+ what = KERN_PROC_SESSION | showthreads;
+ flag = *sesslist.pids;
+ nselectors = 0;
+#endif
+ } else if (ttylist.count == 1) {
+ what = KERN_PROC_TTY | showthreads;
+ flag = *ttylist.ttys;
+ nselectors = 0;
+ } else if (uidlist.count == 1) {
+ what = KERN_PROC_UID | showthreads;
+ flag = *uidlist.uids;
+ nselectors = 0;
+ } else if (all) {
+ /* No need for this routine to select processes. */
+ nselectors = 0;
+ }
}
/*
* select procs
*/
+ nentries = -1;
kp = kvm_getprocs(kd, what, flag, &nentries);
- if ((kp == 0 && nentries != 0) || nentries < 0)
+ if ((kp == NULL && nentries > 0) || (kp != NULL && nentries < 0))
errx(1, "%s", kvm_geterr(kd));
+ nkept = 0;
if (nentries > 0) {
if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL)
errx(1, "malloc failed");
for (i = nentries; --i >= 0; ++kp) {
- kinfo[i].ki_p = kp;
+ /*
+ * If the user specified multiple selection-criteria,
+ * then keep any process matched by the inclusive OR
+ * of all the selection-criteria given.
+ */
+ if (pidlist.count > 0) {
+ for (elem = 0; elem < pidlist.count; elem++)
+ if (kp->ki_pid == pidlist.pids[elem])
+ goto keepit;
+ }
+ /*
+ * Note that we had to process pidlist before
+ * filtering out processes which do not have
+ * a controlling terminal.
+ */
+ if (xkeep == 0) {
+ if ((kp->ki_tdev == NODEV ||
+ (kp->ki_flag & P_CONTROLT) == 0))
+ continue;
+ }
+ if (nselectors == 0)
+ goto keepit;
+ if (gidlist.count > 0) {
+ for (elem = 0; elem < gidlist.count; elem++)
+ if (kp->ki_rgid == gidlist.gids[elem])
+ goto keepit;
+ }
+ if (pgrplist.count > 0) {
+ for (elem = 0; elem < pgrplist.count; elem++)
+ if (kp->ki_pgid == pgrplist.pids[elem])
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list